From dcc2a59792d2213408e994284f492f15d17167b4 Mon Sep 17 00:00:00 2001 From: Ryan Izard <ryan.izard@bigswitch.com> Date: Tue, 19 Jul 2016 17:13:22 -0400 Subject: [PATCH] There won't be any utilization data if we've just turned on the statistics service. --- .../net/floodlightcontroller/topology/TopologyInstance.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java b/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java index 80a41d494..70ce9a400 100644 --- a/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java +++ b/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java @@ -737,7 +737,10 @@ public class TopologyInstance { if (links.get(npt) == null) continue; SwitchPortBandwidth spb = TopologyManager.statisticsService .getBandwidthConsumption(npt.getNodeId(), npt.getPortId()); - long bpsTx = spb.getBitsPerSecondTx().getValue(); + long bpsTx = 0; + if (spb != null) { + bpsTx = spb.getBitsPerSecondTx().getValue(); + } for (Link link : links.get(npt)) { if (link == null) { continue; -- GitLab