From 8e8b678d401af4dce4441fba6c8d9b1f7705c053 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 7 Aug 2014 00:02:20 -0400 Subject: [PATCH] small tweak --- src/topics.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/topics.js b/src/topics.js index 03071beb32..c32f14bcb6 100644 --- a/src/topics.js +++ b/src/topics.js @@ -26,11 +26,7 @@ var async = require('async'), Topics.getTopicData = function(tid, callback) { Topics.getTopicsData([tid], function(err, topics) { - if (err) { - return callback(err); - } - - callback(null, topics ? topics[0] : null); + callback(err, Array.isArray(topics) && topics.length ? topics[0] : null); }); };