Fix a bug when monitoring a flow and there is no path.
diff --git a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
index 6036678..d1eae4d 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
@@ -543,6 +543,13 @@
DataPath dataPath =
topoRouteService.getTopoShortestPath(srcSwitchPort,
dstSwitchPort);
+ if (dataPath == null) {
+ // We need the DataPath to compare the paths
+ dataPath = new DataPath();
+ dataPath.setSrcPort(srcSwitchPort);
+ dataPath.setDstPort(dstSwitchPort);
+ }
+
String newDataPathSummaryStr = dataPath.dataPathSummary();
if (dataPathSummaryStr.equals(newDataPathSummaryStr))
continue; // Nothing changed