1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Added checking for callback before attempting to execute the callback

Signed-off-by: DTrejo <david.trejo@voxer.com>
This commit is contained in:
Shankar Karuppiah
2012-05-08 15:50:31 +03:00
committed by DTrejo
parent 83dc4c999b
commit 71a52638de

View File

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