mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
fix: don't crash if content is undefined
This commit is contained in:
@@ -150,6 +150,7 @@ async function onMessage(socket, payload) {
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
winston.error(err.stack ? err.stack : err.message);
|
||||
callback({ message: err.message });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,10 @@ SocketPosts.editQueuedContent = async function (socket, data) {
|
||||
throw new Error('[[error:invalid-data]]');
|
||||
}
|
||||
await posts.editQueuedContent(socket.uid, data.id, data.content, data.title);
|
||||
if (data.content) {
|
||||
return await plugins.fireHook('filter:parse.post', { postData: data });
|
||||
}
|
||||
return { postData: data };
|
||||
};
|
||||
|
||||
require('../promisify')(SocketPosts);
|
||||
|
||||
Reference in New Issue
Block a user