make sure post exists before edit

This commit is contained in:
barisusakli
2015-10-02 16:39:07 -04:00
parent b616e69070
commit f88d822fe2

View File

@@ -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;