Fix NPE in flow store

Change-Id: If240d2f02c96b3f03398b8ec30a7feb7bb9240b4
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 0008ac1..53b3cd6 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 @@
      * 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*,