mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
crash fix
if composer is opened in a topic that was deleted/purged
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user