Fix for #1564: Return empty array instead of single element nil array in value array processor by NickCraver · Pull Request #1993 · StackExchange/StackExchange.Redis

This changes the return of a nil result through the RedisValueArrayProcessor so that it's a [] instead of a single element [ nil ] in our handling.

This affects the following commands, which are multibulk when a count is provided (even if it's 1), otherwise they are bulkstring. This change affects the non-count case when it's null. Instead of a single element array with a nil value, we'd return an empty array as the Redis surface area intends:

  • LPOP/RPOP
  • SRANDMEMBER
  • SPOP

The other usages of RedisValueArrayProcessor are always multibulk and are not affected:

  • HMGET
  • HKEYS
  • HVALS
  • LRANGE
  • MGET
  • SDIFF
  • SINTER
  • SUNION
  • SMEMBERS
  • SORT
  • XCLAIM
  • Z(REV)RANGE
  • Z(REV)RANGEBYLEX
  • Z(REV)RANGEBYSCORE