ONOS-1114 - NPE for EQUAL switch reconnection
Change-Id: Id5d6f40610bdf4f97e65313c33a91c85678b153b
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
index 8a61fc4..56d01a0 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java
@@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
+
import org.apache.commons.lang3.RandomUtils;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
@@ -549,7 +550,7 @@
// redo ONOS-490
if (deviceNode == null) {
// silently ignore
- return null;
+ return Collections.emptyList();
}
PortInjectedEvent portInjectedEvent = new PortInjectedEvent(providerId, deviceId, portDescriptions);
@@ -564,7 +565,7 @@
}
}
- return deviceEvents;
+ return deviceEvents == null ? Collections.emptyList() : deviceEvents;
}
private List<DeviceEvent> updatePortsInternal(ProviderId providerId,