DATAREDIS-289 - Avoid NPE in DefaultValueOperations#append() in case of pipelining or/and multi/exec calls.
We now return null if DefaultValueOperations#append() was applied to a non-existing list and thus returned null. Previously a NPE was thrown in case of pipelining or/and multi/exec calls. Original pull request: #48.
This commit is contained in:
@@ -218,6 +218,7 @@ public class RedisTemplateTests<K, V> {
|
||||
operations.multi();
|
||||
operations.opsForValue().set("foo", "5");
|
||||
operations.opsForValue().get("foo");
|
||||
operations.opsForValue().append("foo1", "5");
|
||||
operations.opsForList().leftPush("foolist", "6");
|
||||
operations.opsForList().range("foolist", 0l, 1l);
|
||||
operations.opsForSet().add("fooset", "7");
|
||||
@@ -239,7 +240,7 @@ public class RedisTemplateTests<K, V> {
|
||||
Map<Long, Long> map = new LinkedHashMap<Long, Long>();
|
||||
map.put(10l, 11l);
|
||||
assertThat(results,
|
||||
isEqual(Arrays.asList(new Object[] { 5l, 1l, list, 1l, longSet, true, tupleSet, zSet, true, map })));
|
||||
isEqual(Arrays.asList(new Object[] { 5l, 1L, 1l, list, 1l, longSet, true, tupleSet, zSet, true, map })));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user