commit | b713dded6c5dafc3fb70b02c876153d3d808b76e | [log] [tgz] |
---|---|---|
author | Charles Chan <rascov@gmail.com> | Sun Apr 24 21:24:07 2016 -0700 |
committer | Charles Chan <rascov@gmail.com> | Sun Apr 24 21:24:07 2016 -0700 |
tree | d01cadb5751c6059b312a4e5da07dc953f3ed6b9 | |
parent | d299036a4d296d41e7af53477eb58f47a27f6745 [diff] |
ONOS-4395 Fix NPE in OpenFlowDeviceProvider Change-Id: I88c3671fa490cf978485267a104bf2bcc0f57e58
diff --git a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java index f3dfdff..bb2df35 100644 --- a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java +++ b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
@@ -312,6 +312,10 @@ List<OFPortStatsEntry> entries) { HashSet<PortStatistics> stats = Sets.newHashSet(); + if (entries == null) { + return Collections.unmodifiableSet(stats); + } + for (OFPortStatsEntry entry : entries) { try { if (entry == null || entry.getPortNo() == null || entry.getPortNo().getPortNumber() < 0) { @@ -339,7 +343,6 @@ } return Collections.unmodifiableSet(stats); - } private class InternalDeviceProvider implements OpenFlowSwitchListener, OpenFlowEventListener {