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"); } }