You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Bounds checking on Array expansion magic.
This commit is contained in:
2
index.js
2
index.js
@@ -632,7 +632,7 @@ RedisClient.prototype.send_command = function (command, args, callback) {
|
|||||||
// and converts to:
|
// and converts to:
|
||||||
// client.command(arg1, arg2, arg3, arg4, cb);
|
// client.command(arg1, arg2, arg3, arg4, cb);
|
||||||
// which is convenient for some things like sadd
|
// which is convenient for some things like sadd
|
||||||
if (Array.isArray(args[args.length - 1])) {
|
if (args.length > 0 && Array.isArray(args[args.length - 1])) {
|
||||||
args = args.slice(0, -1).concat(args[args.length - 1]);
|
args = args.slice(0, -1).concat(args[args.length - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user