Fix NPE in flow store

Change-Id: If240d2f02c96b3f03398b8ec30a7feb7bb9240b4
This commit is contained in:
Jordan Halterman 2019-03-07 15:52:34 -08:00
parent b2e6be83e5
commit 0677d88e2d

View File

@ -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*,