diff options
author | Dmitry <uvarov.dl@gmail.com> | 2012-10-11 18:07:45 +0400 |
---|---|---|
committer | Dmitry <uvarov.dl@gmail.com> | 2012-10-11 18:07:45 +0400 |
commit | dbcdc2f956172d4d0c89424ff5114c57b71cb4e3 (patch) | |
tree | f12bda4b4118dad717ea881cf954b9152deea64d | |
parent | 0fa954c1a0d2a7e2c6c1d3dcc9987889857f77d9 (diff) | |
download | etherpad-lite-dbcdc2f956172d4d0c89424ff5114c57b71cb4e3.zip |
fix for error handling in callback code
The callback code does not follow error handling guidelines, thus always
receiving NULL instead of results array.
-rw-r--r-- | src/node/handler/PadMessageHandler.js | 4 |
1 files changed, 3 insertions, 1 deletions
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; |