Skip to content

Commit

Permalink
Added checking for callback before attempting to execute the callback
Browse files Browse the repository at this point in the history
Signed-off-by: DTrejo <david.trejo@voxer.com>
  • Loading branch information
Shankar Karuppiah authored and DTrejo committed Jul 6, 2012
1 parent 83dc4c9 commit 71a5263
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Expand Up @@ -672,7 +672,12 @@ RedisClient.prototype.send_command = function (command, args, callback) {
this.offline_queue.push(command_obj);
this.should_buffer = true;
} else {
command_obj.callback(new Error('send command: stream is not writeable.'));
var not_writeable_error = new Error('send_command: stream not writeable. enable_offline_queue is false');
if (command_obj.callback) {
command_obj.callback(not_writeable_error);
} else {
throw not_writeable_error;
}
}

return false;
Expand Down

0 comments on commit 71a5263

Please sign in to comment.