From b52dba5c920af320b461ee18c54affebccca02a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 1 Apr 2019 08:27:37 -0400 Subject: [PATCH] fix: #7508 --- src/posts/queue.js | 2 +- test/posts.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/posts/queue.js b/src/posts/queue.js index d2203fdc68..1a3a0dadd8 100644 --- a/src/posts/queue.js +++ b/src/posts/queue.js @@ -215,7 +215,7 @@ module.exports = function (Posts) { }, function (data, next) { if (!data) { - return callback(); + return callback(null, null); } try { data.data = JSON.parse(data.data); diff --git a/test/posts.js b/test/posts.js index 22f84c76ae..1d20bb303f 100644 --- a/test/posts.js +++ b/test/posts.js @@ -928,6 +928,13 @@ describe('Post\'s', function () { }, ], done); }); + + it('should not crash if id does not exist', function (done) { + socketPosts.reject({ uid: globalModUid }, { id: '123123123' }, function (err) { + assert.ifError(err); + done(); + }); + }); }); describe('upload methods', function () {