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());
     }