commit | d377fe664329a00ee69b41cf06df3f122206f2c6 | [log] [tgz] |
---|---|---|
author | fran <francesco.lucrezia@gmail.com> | Thu Sep 14 09:52:24 2017 +0200 |
committer | fran <francesco.lucrezia@gmail.com> | Thu Sep 14 16:01:29 2017 +0200 |
tree | 021ce23ca87a224d20420794bbe3572a89b118af | |
parent | 937ff5c1e5d7a1e1a96c52a2e5dd4fe10985ffad [diff] |
Avoid NPexception on domainId mismatch Change-Id: Icad4c3e21e92c133efd51423890f30f7137ad6f4
diff --git a/global/http-channel/src/main/java/org/opencord/ce/global/channel/client/HttpClientInstance.java b/global/http-channel/src/main/java/org/opencord/ce/global/channel/client/HttpClientInstance.java index eb820fb..5190363 100644 --- a/global/http-channel/src/main/java/org/opencord/ce/global/channel/client/HttpClientInstance.java +++ b/global/http-channel/src/main/java/org/opencord/ce/global/channel/client/HttpClientInstance.java
@@ -112,7 +112,7 @@ } private boolean isLeader(String topic) { - return leadershipService.getLeader(topic).id() + return topic != null && leadershipService.getLeader(topic).id() .equals(clusterService.getLocalNode().id().id()); } @@ -135,7 +135,11 @@ } private String getTopic(DomainId domainId) { - return domainsEndPointsMap.get(domainId).getRight().topic(); + if (domainsEndPointsMap.get(domainId) != null) { + return domainsEndPointsMap.get(domainId).getRight().topic(); + } + log.info("Domain ID {} not among configured domain IDs", domainId.id()); + return null; } private Client createClient() {