diff --git a/README.md b/README.md index 831a6aa303..563b3edae4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # NodeBB [![Build Status](https://travis-ci.org/NodeBB/NodeBB.svg?branch=master)](https://travis-ci.org/NodeBB/NodeBB) [![Dependency Status](https://david-dm.org/nodebb/nodebb.svg)](https://david-dm.org/nodebb/nodebb) -[![Code Climate](https://codeclimate.com/github/designcreateplay/NodeBB.png)](https://codeclimate.com/github/designcreateplay/NodeBB) +[![Code Climate](https://codeclimate.com/github/NodeBB/NodeBB/badges/gpa.svg)](https://codeclimate.com/github/NodeBB/NodeBB) [![Documentation Status](https://readthedocs.org/projects/nodebb/badge/?version=latest)](https://readthedocs.org/projects/nodebb/?badge=latest) **NodeBB Forum Software** is powered by Node.js and built on a Redis database. It utilizes web sockets for instant interactions and real-time notifications. NodeBB is compatible down to IE8 and has many modern features out of the box such as social network integration and streaming discussions. diff --git a/src/socket.io/modules.js b/src/socket.io/modules.js index 45fde242dd..1156b1c379 100644 --- a/src/socket.io/modules.js +++ b/src/socket.io/modules.js @@ -71,6 +71,10 @@ SocketModules.composer.push = function(socket, pid, callback) { return callback(err); } + if (!results.topic) { + return callback(new Error('[[error:no-topic]]')); + } + callback(null, { pid: pid, body: postData.content, diff --git a/src/topics/posts.js b/src/topics/posts.js index a3366d6c40..159aa7546b 100644 --- a/src/topics/posts.js +++ b/src/topics/posts.js @@ -247,6 +247,9 @@ module.exports = function(Topics) { Topics.getTopicDataByPid = function(pid, callback) { posts.getPostField(pid, 'tid', function(err, tid) { + if (err) { + return callback(err); + } Topics.getTopicData(tid, callback); }); };