judge endpoint (#8933)

This commit is contained in:
胡俊 2022-08-11 14:16:59 +08:00 committed by GitHub
parent 3586ad64c9
commit 65244c5de4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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