You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
hmset throws/errors out on non-string values. fixes #218
This commit is contained in:
5
index.js
5
index.js
@@ -898,6 +898,11 @@ RedisClient.prototype.hmset = function (args, callback) {
|
||||
for (i = 0, il = tmp_keys.length; i < il ; i++) {
|
||||
key = tmp_keys[i];
|
||||
tmp_args.push(key);
|
||||
if (typeof args[1][key] !== "string") {
|
||||
var err = new Error("hmset expected value to be a string", key, ":", args[1][key]);
|
||||
if (callback) return callback(err);
|
||||
else throw err;
|
||||
}
|
||||
tmp_args.push(args[1][key]);
|
||||
}
|
||||
args = tmp_args;
|
||||
|
Reference in New Issue
Block a user