mcollina/mosca — pull request #59 by justcfx2u (2013-09-23 15:04:31+00:00)
Title: Keep calm and redis on if no client to clean.

When attempting to use Redis as a QoS 1 persistence factory, the following command...

mosquitto_pub -t "hello" -m "world"

...makes mosca explode...

/home/wat/foo/node_modules/mosca/node_modules/redis/index.js:551
throw err;
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at /home/wat/foo/node_modules/mosca/lib/persistence/redis.js:212:14
at try_callback (/home/wat/foo/node_modules/mosca/node_modules/redis/index.js:548:9)
at RedisClient.return_reply (/home/wat/foo/node_modules/mosca/node_modules/redis/index.js:630:13)
at ReplyParser. (/home/wat/foo/node_modules/mosca/node_modules/redis/index.js:282:14)
at ReplyParser.EventEmitter.emit (events.js:95:17)
at ReplyParser.send_reply (/home/wat/foo/node_modules/mosca/node_modules/redis/lib/parser/javascript.js:300:10)
at ReplyParser.execute (/home/wat/foo/node_modules/mosca/node_modules/redis/lib/parser/javascript.js:203:22)
at RedisClient.on_data (/home/wat/foo/node_modules/mosca/node_modules/redis/index.js:504:27)
at Socket. (/home/wat/foo/node_modules/mosca/node_modules/redis/index.js:82:14)

This happens when a null is gotten back from Redis in _cleanClient().