From 65244c5de48cb28d90b69a936ba27feeb7d1a245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BF=8A?= Date: Thu, 11 Aug 2022 14:16:59 +0800 Subject: [PATCH] judge endpoint (#8933) --- .../alibaba/nacos/client/naming/core/ServerListManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/core/ServerListManager.java b/client/src/main/java/com/alibaba/nacos/client/naming/core/ServerListManager.java index 14ac914a4..bec1d6a3a 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/core/ServerListManager.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/core/ServerListManager.java @@ -87,7 +87,8 @@ public class ServerListManager implements ServerListFactory, Closeable { initServerAddr(properties); if (!serverList.isEmpty()) { currentIndex.set(new Random().nextInt(serverList.size())); - } else { + } + if (serverList.isEmpty() && StringUtils.isNotEmpty(endpoint)) { throw new NacosLoadException("serverList is empty,please check configuration"); } }