if composer is opened in a topic that was deleted/purged
@ -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,
@ -248,6 +248,9 @@ module.exports = function(Topics) {
Topics.getTopicDataByPid = function(pid, callback) {
posts.getPostField(pid, 'tid', function(err, tid) {
if (err) {
Topics.getTopicData(tid, callback);
});
};