When errors occurs using multi/exec, avoid "TypeError: Cannot read property 'length' of undefined"
Fix TypeError when handling multi exception
Hi @kwangsu61 -- can you provide an example, test case, or existing issue with one of those for me to provide some context?
for example, when Redis server is down (Redis connection to xxx failed - connect ECONNREFUSED),
if multi/exec is executed,
"TypeError: Cannot read property 'length' of undefined"(1056 line : cur.length) occurs.
I just filed #478 because I encountered this issue. I also provided a demo coffeescript program that demonstrates the behavior.
Hi @bpytlik this fix needs more work. Right now this completely breaks the current test suite. My guess is instead of never splicing some sort of logic is required to see when splicing is applicable.
Ahh, nope, I was wrong -- this does not break any of the current tests. Sorry for the misinformation! Will evaluate how to add a test for this.
@brycebaril I didn't offer a fix, @kwangsu61 did though :) I offered a CS file that demonstrates the issue.
Adding test for #457
Thanks! I went ahead and added a test.
I have found this error again in node redis 0.12
@lamujeresponja -- can you reproduce the error, and if so can you provide a code snippet that does? Thanks!