From 8ea3ee080f18d7a5d56fef6747fdb125b482bd53 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 Oct 2012 18:07:45 +0400 Subject: [PATCH] fix for error handling in callback code The callback code does not follow error handling guidelines, thus always receiving NULL instead of results array. --- src/node/handler/PadMessageHandler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 831acdbb..b889a8a0 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -176,7 +176,9 @@ exports.handleMessage = function(client, message) // Call handleMessage hook. If a plugin returns null, the message will be dropped. Note that for all messages // handleMessage will be called, even if the client is not authorized - hooks.aCallAll("handleMessage", { client: client, message: message }, function ( messages ) { + hooks.aCallAll("handleMessage", { client: client, message: message }, function ( err, messages ) { + if(ERR(err, callback)) return; + _.each(messages, function(newMessage){ if ( newMessage === null ) { dropMessage = true;