diff --git a/redisson/src/main/java/org/redisson/RedissonScript.java b/redisson/src/main/java/org/redisson/RedissonScript.java index 2691a4f5b..4004e89b8 100644 --- a/redisson/src/main/java/org/redisson/RedissonScript.java +++ b/redisson/src/main/java/org/redisson/RedissonScript.java @@ -205,13 +205,13 @@ public class RedissonScript implements RScript { RFuture f = commandExecutor.evalReadAsync(key, codec, cmd, shaDigest, keys, encode(Arrays.asList(values), codec).toArray()); CompletableFuture result = new CompletableFuture<>(); f.whenComplete((r, e) -> { - if (e != null) { - if (e.getMessage().startsWith("ERR unknown command")) { - commandExecutor.setEvalShaROSupported(false); - RFuture s = evalShaAsync(key, mode, shaDigest, returnType, keys, values); - commandExecutor.transfer(s.toCompletableFuture(), result); - } + if (e != null && e.getMessage().startsWith("ERR unknown command")) { + commandExecutor.setEvalShaROSupported(false); + RFuture s = evalShaAsync(key, mode, shaDigest, returnType, keys, values); + commandExecutor.transfer(s.toCompletableFuture(), result); + return; } + commandExecutor.transfer(f.toCompletableFuture(), result); }); return new CompletableFutureWrapper<>(result); }