commit | c708e3c8a22ebd96918617a47d4bdba8e9f7fa1a | [log] [tgz] |
---|---|---|
author | Donghee Yoon <d.yoon@samsung.com> | Fri Mar 31 14:09:42 2017 +0900 |
committer | Ray Milkey <ray@onlab.us> | Fri Mar 31 06:42:48 2017 +0000 |
tree | 8a331d6d16bb5ce2a0f666db4118d1e4ffaa48e5 | |
parent | b46d2200f30192ca67f4f96b36ce3ba3d9684417 [diff] |
remove dereferencing a null pointer Change-Id: I2e55920e430a20585c3997122b02540306b21dca
diff --git a/core/api/src/main/java/org/onosproject/cluster/PartitionDiff.java b/core/api/src/main/java/org/onosproject/cluster/PartitionDiff.java index 71806d2..f66f74e 100644 --- a/core/api/src/main/java/org/onosproject/cluster/PartitionDiff.java +++ b/core/api/src/main/java/org/onosproject/cluster/PartitionDiff.java
@@ -36,7 +36,7 @@ public PartitionDiff(Partition oldValue, Partition newValue) { this.oldValue = oldValue; this.newValue = newValue; - this.partitionId = oldValue.getId(); + this.partitionId = oldValue == null ? null : oldValue.getId(); this.currentMembers = oldValue == null ? ImmutableSet.of() : ImmutableSet.copyOf(oldValue.getMembers()); this.newMembers = newValue == null ? ImmutableSet.of() : ImmutableSet.copyOf(newValue.getMembers()); }