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:
reta
2014-03-26 13:46:17 +01:00
committed by Thomas Darimont
parent f366ffc94e
commit aa739f4135
2 changed files with 4 additions and 2 deletions

View File

@@ -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);
}