crash fix

if composer is opened in a topic that was deleted/purged
v1.18.x
barisusakli 11 years ago
parent 43ca61de8c
commit 0b79a73732

@ -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) {
return callback(err);
}
Topics.getTopicData(tid, callback);
});
};

Loading…
Cancel
Save