Skip to content

Loading…

TypeError: Cannot read property 'length' of null #28

Open
Valid opened this Issue · 5 comments

5 participants

@Valid

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. (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:337:28)
at Stream.emit (events:25:26)
at IOWatcher.callback (net:369:16)
at node.js:204:9

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.

@Sembiance

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.

@Sembiance

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.

@MiketoString

Seeing the same issue, patched seemed to fix it for me as well. Getting error on a "smembers" call.

@lacker

It looks like this happens when you do a hmget on a key that doesn't exist yet.

@john-ka-peter

That patch is worked for me

Node.js Training in Chennai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.