From fd767a10a65013cb7b3ec414885a00a95c2ada60 Mon Sep 17 00:00:00 2001 From: qifanwang Date: Mon, 21 Oct 2024 11:10:09 +0800 Subject: [PATCH] fix bug for NPE in reset sentinels --- .../actions/sentinel/collector/command/ResetSentinels.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/sentinel/collector/command/ResetSentinels.java b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/sentinel/collector/command/ResetSentinels.java index fec5c9f739..d10a718f04 100644 --- a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/sentinel/collector/command/ResetSentinels.java +++ b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/sentinel/collector/command/ResetSentinels.java @@ -429,7 +429,7 @@ public String getName() { @Override protected void doExecute() throws Throwable { - if (slaves.isEmpty()) + if (slaves == null || slaves.isEmpty()) future().setSuccess(new SentinelInvalidSlaves()); else { Set toManyKeepers = tooManyKeepers(slaves);