Skip to content

Commit

Permalink
Fix Urls may be null, and NullPointerException will be thrown in Conf…
Browse files Browse the repository at this point in the history
…igValidationUtils (apache#8020)

Signed-off-by: xingrufei <xingrufei@sogou-inc.com>
  • Loading branch information
skyguard1 committed Jun 9, 2021
1 parent 584ab28 commit 9bbc8db
Showing 1 changed file with 11 additions and 9 deletions.
Expand Up @@ -205,15 +205,17 @@ public static List<URL> loadRegistries(AbstractInterfaceConfig interfaceConfig,
}
List<URL> urls = UrlUtils.parseURLs(address, map);

for (URL url : urls) {

url = URLBuilder.from(url)
.addParameter(REGISTRY_KEY, url.getProtocol())
.setProtocol(extractRegistryType(url))
.build();
if ((provider && url.getParameter(REGISTER_KEY, true))
|| (!provider && url.getParameter(SUBSCRIBE_KEY, true))) {
registryList.add(url);
if (CollectionUtils.isNotEmpty(urls)) {
for (URL url : urls) {

url = URLBuilder.from(url)
.addParameter(REGISTRY_KEY, url.getProtocol())
.setProtocol(extractRegistryType(url))
.build();
if ((provider && url.getParameter(REGISTER_KEY, true))
|| (!provider && url.getParameter(SUBSCRIBE_KEY, true))) {
registryList.add(url);
}
}
}
}
Expand Down

0 comments on commit 9bbc8db

Please sign in to comment.