fix empty unsub/punsub TypeError calling toString on null #408

Merged
merged 3 commits into from Apr 27, 2013
Commits on Mar 26, 2013
  1. @jeffbski

    failing tests for empty unsub and punsub

    jeffbski committed Mar 26, 2013
    When unsubscribe or punsubscribe is called
    and there is nothing to unsubscribe from, the reply[1]
    argument is a null which causes a TypeError
    Cannot call method 'toString' of null
    
    ```
    TypeError: Cannot call method 'toString' of null
        at RedisClient.return_reply (/Users/barczewskij/projects/node_redis/index.js:633:65)
        at ReplyParser.RedisClient.init_parser (/Users/barczewskij/projects/node_redis/index.js:266:14)
        at ReplyParser.EventEmitter.emit (events.js:96:17)
        at ReplyParser.send_reply (/Users/barczewskij/projects/node_redis/lib/parser/javascript.js:300:10)
        at ReplyParser.execute (/Users/barczewskij/projects/node_redis/lib/parser/javascript.js:211:22)
        at RedisClient.on_data (/Users/barczewskij/projects/node_redis/index.js:483:27)
        at Socket.<anonymous> (/Users/barczewskij/projects/node_redis/index.js:82:14)
        at Socket.EventEmitter.emit (events.js:96:17)
        at TCP.onread (net.js:396:14)
    ```
  2. @jeffbski

    fix empty unsub/punsub TypeError

    jeffbski committed Mar 26, 2013
    When unsubscribe or punsubscribe is called and it has
    no subscriptions, the reply[1] is a null which causes
    `TypeError: Cannot call method 'toString' of null`
    
    Check if reply[1] is null before calling toString otherwise
    just pass null.
Commits on Mar 27, 2013
  1. @jeffbski

    limit cbtests to 2.6.11 and above

    jeffbski committed Mar 27, 2013
    Test hangs on older versions of Redis