fix for error handling in callback code

The callback code does not follow error handling guidelines, thus always
receiving NULL instead of results array.
This commit is contained in:
Dmitry 2012-10-11 18:07:45 +04:00 committed by Marcel Klehr
parent e0d4a16208
commit 8ea3ee080f

View file

@ -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;