redis-mock is going to crash if calling set('key', null)
(null || undefined).toString() got a fatal error
String(null || undefined) is a good way to fix it
Error
should set `null` as value:
TypeError: Cannot read property 'toString' of null
at parseArguments (/Users/danielssun/Projects/redis-mock/lib/redis-mock.js:39:29)
at RedisClient.set.RedisClient.SET (/Users/danielssun/Projects/redis-mock/lib/redis-mock.js:353:16)
at context.<anonymous> (/Users/danielssun/Projects/redis-mock/test/redis-mock.strings.test.js:47:7)
at Test.Runnable.run (/Users/danielssun/Projects/redis-mock/node_modules/mocha/lib/runnable.js:233:15)
at Runner.runTest (/Users/danielssun/Projects/redis-mock/node_modules/mocha/lib/runner.js:387:10)
at /Users/danielssun/Projects/redis-mock/node_modules/mocha/lib/runner.js:470:12
at next (/Users/danielssun/Projects/redis-mock/node_modules/mocha/lib/runner.js:312:14)
at /Users/danielssun/Projects/redis-mock/node_modules/mocha/lib/runner.js:322:7
at next (/Users/danielssun/Projects/redis-mock/node_modules/mocha/lib/runner.js:257:23)
at Immediate._onImmediate (/Users/danielssun/Projects/redis-mock/node_modules/mocha/lib/runner.js:289:5)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
redis-mock
is going to crash if callingset('key', null)
(null || undefined).toString()
got a fatal errorString(null || undefined)
is a good way to fix itError