commit | dbe8a813b844dc1b84b9a889504fcb36aebc4688 | [log] [tgz] |
---|---|---|
author | Madan Jampani <madan.jampani@gmail.com> | Sun Jan 31 21:10:46 2016 -0800 |
committer | Madan Jampani <madan.jampani@gmail.com> | Sun Jan 31 21:10:46 2016 -0800 |
tree | 66ed3342975703af51d44fc7b7d5d774db6be5bb | |
parent | 4124bc365f7abe0c4271e0b09065e66d88a0241c [diff] |
Fixes NPE in ConsistentDeviceMastershipStore Change-Id: Id07c8d41338a48e58d7e3ea98312691a2011eeef
diff --git a/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java b/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java index a2a0081..bd5eea5 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java
@@ -236,7 +236,8 @@ String leadershipTopic = createDeviceMastershipTopic(deviceId); Leadership leadership = leadershipService.getLeadership(leadershipTopic); - return leadership != null ? MastershipTerm.of(leadership.leaderNodeId(), leadership.leader().term()) : null; + return leadership != null && leadership.leaderNodeId() != null ? + MastershipTerm.of(leadership.leaderNodeId(), leadership.leader().term()) : null; } @Override @@ -349,4 +350,4 @@ Matcher m = DEVICE_MASTERSHIP_TOPIC_PATTERN.matcher(topic); return m.matches(); } -} \ No newline at end of file +}