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:
@@ -84,7 +84,8 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
return execute(new RedisCallback<Integer>() {
|
||||
|
||||
public Integer doInRedis(RedisConnection connection) {
|
||||
return connection.append(rawKey, rawString).intValue();
|
||||
final Long result = connection.append(rawKey, rawString);
|
||||
return ( result != null ) ? result.intValue() : null;
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user