throw JedisDataException when sending NULL values to redis as it is not a valid value in the protocol
This commit is contained in:
@@ -9,6 +9,7 @@ import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisShardInfo;
|
||||
import redis.clients.jedis.Protocol;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
import redis.clients.jedis.tests.commands.JedisCommandTestBase;
|
||||
import redis.clients.util.SafeEncoder;
|
||||
|
||||
@@ -53,4 +54,9 @@ public class JedisTest extends JedisCommandTestBase {
|
||||
Thread.sleep(20000);
|
||||
jedis.hmget("foobar", "foo");
|
||||
}
|
||||
|
||||
@Test(expected = JedisDataException.class)
|
||||
public void failWhenSendingNullValues() {
|
||||
jedis.set("foo", null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user