From 52a53df80d1c466769d2d0e6f82e90a6aa1f7356 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 11 Dec 2014 23:59:23 -0500 Subject: [PATCH] missing err check --- src/topics/posts.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/topics/posts.js b/src/topics/posts.js index 7cecf809b9..a89f368782 100644 --- a/src/topics/posts.js +++ b/src/topics/posts.js @@ -175,6 +175,9 @@ module.exports = function(Topics) { Topics.addPostToTopic = function(tid, pid, timestamp, votes, callback) { Topics.getTopicField(tid, 'mainPid', function(err, mainPid) { + if (err) { + return callback(err); + } if (!parseInt(mainPid, 10)) { Topics.setTopicField(tid, 'mainPid', pid, callback); } else {