You've already forked node-redis
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:
committed by
DTrejo
parent
83dc4c999b
commit
71a52638de
7
index.js
7
index.js
@@ -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;
|
||||
|
Reference in New Issue
Block a user