From ba32a4dc4f105ef3b9b4c4a6147d9d533ffe9129 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 5 Sep 2014 13:44:58 -0400 Subject: [PATCH] crash fix --- src/categories.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/categories.js b/src/categories.js index 8043401830..aaf732151b 100644 --- a/src/categories.js +++ b/src/categories.js @@ -414,7 +414,11 @@ var db = require('./database'), Categories.onNewPostMade = function(postData) { topics.getTopicFields(postData.tid, ['cid', 'pinned'], function(err, topicData) { if (err) { - winston.error(err.message); + return winston.error(err.message); + } + + if (!topicData) { + return; } var cid = topicData.cid;