From 21ef4218c09518cce3637598610ee11b83036bd0 Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Mon, 21 Apr 2014 00:25:49 +0300 Subject: [PATCH] [FIX] Call wrong error handeling --- social/kickass/99-kickass.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/social/kickass/99-kickass.js b/social/kickass/99-kickass.js index de4a40e1..c54cfc42 100644 --- a/social/kickass/99-kickass.js +++ b/social/kickass/99-kickass.js @@ -30,10 +30,11 @@ function KickassNode(n) { }); this.on("input", function (msg) { var query = msg.topic || this.title; + msg.topic = query; + msg.payload = []; this.kickass.setQuery(query).run(function (errors, data) { if (!errors.length > 0) { - msg.topic = query; - msg.payload = []; + data.forEach(function (torrent) { var parsedTorrent = {}; parsedTorrent.title = torrent.title; @@ -47,7 +48,8 @@ function KickassNode(n) { }); node.send(msg); } else { - node.err(errors); + node.error(errors); + node.send(msg); } }); });