Skip to content

Commit

Permalink
Fixed - RedissonBaseLock throws NPE. #4555
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Koksharov committed Sep 30, 2022
1 parent 91268be commit a5502b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion redisson/src/main/java/org/redisson/RedissonBaseLock.java
Expand Up @@ -207,7 +207,12 @@ protected void cancelExpirationRenewal(Long threadId) {

protected <T> RFuture<T> evalWriteAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params) {
MasterSlaveEntry entry = commandExecutor.getConnectionManager().getEntry(getRawName());
int availableSlaves = entry.getAvailableSlaves();
int availableSlaves;
if (entry != null) {
availableSlaves = entry.getAvailableSlaves();
} else {
availableSlaves = 0;
}

CommandBatchService executorService = createCommandBatchService(availableSlaves);
RFuture<T> result = executorService.evalWriteAsync(key, codec, evalCommandType, script, keys, params);
Expand Down

0 comments on commit a5502b6

Please sign in to comment.