DATAKV-38
+ fix potential NPE on init
This commit is contained in:
@@ -74,7 +74,7 @@ public class RedisAtomicInteger extends Number implements Serializable, KeyBound
|
||||
this.generalOps = redisTemplate;
|
||||
this.operations = generalOps.opsForValue();
|
||||
|
||||
if (initialValue == null && this.operations.get(redisCounter) == null) {
|
||||
if (initialValue == null || this.operations.get(redisCounter) == null) {
|
||||
set(0);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class RedisAtomicLong extends Number implements Serializable, KeyBound<St
|
||||
this.generalOps = redisTemplate;
|
||||
this.operations = generalOps.opsForValue();
|
||||
|
||||
if (initialValue == null && this.operations.get(redisCounter) == null) {
|
||||
if (initialValue == null || this.operations.get(redisCounter) == null) {
|
||||
set(0);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user