Skip to content
Browse files

Add a null check.

  • Loading branch information...
1 parent 6e1f746 commit 6d9f1a49b54fd8253479ab45359b4b32ab78f977 @Kami Kami committed Mar 27, 2013
View
8 ...chaius/src/main/java/com/netflix/config/sources/ServiceRegistryConfigurationProvider.java
@@ -48,9 +48,15 @@ public PollResult poll(boolean initial, Object checkPoint)
for (String tag: serviceTags) {
Set<InetSocketAddress> pairs = new HashSet<InetSocketAddress>();
String key = PREFIX + DELIMITER + tag + DELIMITER + SUFFIX;
+
for (Service service : client.getServices(tag)) {
- pairs.add(getHostPortPair(service));
+ InetSocketAddress pair = getHostPortPair(service);
+
+ if (pair != null) {
+ pairs.add(pair);
+ }
}
+
if (!pairs.isEmpty()) {
map.put(key, StringUtils.join(pairs, SEPARATOR));
}

0 comments on commit 6d9f1a4

Please sign in to comment.
Something went wrong with that request. Please try again.