redis-node-client
redis-node-client copied to clipboard
TypeError: Cannot read property 'length' of null
TypeError: Cannot read property 'length' of null
at Client.handlePublishedMessage_ (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:423:42)
at Client.onReply_ (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:390:14)
at /home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:136:34
at ReplyParser.feed (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:198:25)
at Stream.
Using the latest from HEAD for redis, node, and redis-node-client
I'm not actually doing anything with pubsub, so I think there's an errant call somewhere, when it's running the code when it doesn't need to.
I'm getting this too.
Here is how you reproduce it:
redis.hmget("AntKey", "any0", "any1", "any2", "any3", function() {} );
That will produce this exception:
reply.value[0].value.length == 8 && ^ TypeError: Cannot read property 'length' of null at Client.handlePublishedMessage_ (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:427:43) at Client.onReply_ (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:390:14) at /mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:136:34 at ReplyParser.feed (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:183:29) at Stream.(/mnt/compendium/DevLab//lib/redis-node-client/lib/redis-client.js:337:28) at Stream.emit (events:25:26) at IOWatcher.callback (net:510:16) at node.js:228:9
You get a slightly different error if you reduce the number of keys requested down to 3.
If you reduce it to two, it doesn't throw any exceptions.
I made a patch, you can find it here: http://www.telparia.com/redis-client.js.patch
Seems to work, but I don't have enough understanding of the code to know whether or not this causes more issues.
Seeing the same issue, patched seemed to fix it for me as well. Getting error on a "smembers" call.
It looks like this happens when you do a hmget on a key that doesn't exist yet.