fix for error handling in callback code

The callback code does not follow error handling guidelines, thus always
receiving NULL instead of results array.
pull/1057/head
Dmitry 2012-10-11 18:07:45 +04:00
parent 0fa954c1a0
commit dbcdc2f956
1 changed files with 3 additions and 1 deletions

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 // 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 // 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){ _.each(messages, function(newMessage){
if ( newMessage === null ) { if ( newMessage === null ) {
dropMessage = true; dropMessage = true;