From 0677d88e2dd1a32f6239829e3b70a39fa2a634cc Mon Sep 17 00:00:00 2001 From: Jordan Halterman Date: Thu, 7 Mar 2019 15:52:34 -0800 Subject: [PATCH] Fix NPE in flow store Change-Id: If240d2f02c96b3f03398b8ec30a7feb7bb9240b4 --- .../java/org/onosproject/store/flow/impl/DeviceFlowTable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DeviceFlowTable.java b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DeviceFlowTable.java index 0008ac1f0d..53b3cd62d1 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DeviceFlowTable.java +++ b/core/store/dist/src/main/java/org/onosproject/store/flow/impl/DeviceFlowTable.java @@ -761,7 +761,8 @@ public class DeviceFlowTable { * Handles an update to a term. */ private void updateTerm(DeviceReplicaInfo replicaInfo) { - if (replicaInfo.term() == this.replicaInfo.term()) { + DeviceReplicaInfo oldReplicaInfo = this.replicaInfo; + if (oldReplicaInfo != null && replicaInfo.term() == oldReplicaInfo.term()) { this.replicaInfo = replicaInfo; // If the local node is neither the master or a backup for the device *and the term is active*,