fix for mastership race condition.

Change-Id: Id219bdf00f3d6501027566d54342c5d7c1b27789
diff --git a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
index 292d761..c99f874 100644
--- a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
+++ b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
@@ -614,7 +614,11 @@
             }
 
             // device is connected to this node:
-            reassertRole(did, myNextRole);
+            if (store.getDevice(did) != null) {
+                reassertRole(did, myNextRole);
+            } else {
+                log.warn("Device is not yet/no longer in the store: {}", did);
+            }
         }
     }