mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
make sure post exists before edit
This commit is contained in:
@@ -34,6 +34,9 @@ module.exports = function(Posts) {
|
||||
Posts.getPostData(data.pid, next);
|
||||
},
|
||||
function (_postData, next) {
|
||||
if (!_postData) {
|
||||
return next(new Error('[[error:no-post]]'));
|
||||
}
|
||||
postData = _postData;
|
||||
postData.content = data.content;
|
||||
postData.edited = now;
|
||||
|
||||
Reference in New Issue
Block a user