fix: don't crash if content is undefined

This commit is contained in:
Barış Soner Uşaklı
2020-07-22 17:03:29 -04:00
parent 5a5abf3c4e
commit 4658121a7d
2 changed files with 5 additions and 1 deletions

View File

@@ -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);
return await plugins.fireHook('filter:parse.post', { postData: data });
if (data.content) {
return await plugins.fireHook('filter:parse.post', { postData: data });
}
return { postData: data };
};
require('../promisify')(SocketPosts);