Skip to content

Commit

Permalink
Defensive check to solve issue #3923 (#3931)
Browse files Browse the repository at this point in the history
  • Loading branch information
beiwei30 authored and ralf0131 committed Apr 26, 2019
1 parent 083605a commit 793bf82
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -200,7 +201,11 @@ private boolean isProviderSide(URL url) {

private List<URL> convert(List<HealthService> services) {
return services.stream()
.map(s -> s.getService().getMeta().get(URL_META_KEY))
.map(HealthService::getService)
.filter(Objects::nonNull)
.map(HealthService.Service::getMeta)
.filter(m -> m != null && m.containsKey(URL_META_KEY))
.map(m -> m.get(URL_META_KEY))
.map(URL::valueOf)
.collect(Collectors.toList());
}
Expand Down

0 comments on commit 793bf82

Please sign in to comment.