Fixing a couple of NPE in the newly added Connection Manager UI. 26/2526/2
authorMadhu Venugopal <mavenugo@gmail.com>
Thu, 7 Nov 2013 23:05:46 +0000 (15:05 -0800)
committerAndrew Kim <andrekim@cisco.com>
Thu, 7 Nov 2013 23:11:40 +0000 (17:11 -0600)
Change-Id: Ib0904df810b5dbab8e8642d2650d58b63d28bec1
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java

index 91261f6499fe6092595117d9f90e1eb967f4003a..3d33edcbf2272c308cdb2236c574aaa42cd95ed9 100644 (file)
@@ -751,9 +751,15 @@ public class Devices implements IDaylightWeb {
 
         Set<Node> nodes = connectionManager.getLocalNodes();
         List<NodeJsonBean> result = new LinkedList<NodeJsonBean>();
+        if (nodes == null) {
+            return result;
+        }
         for (Node node : nodes) {
             Description descriptionProperty = (Description) switchManager.getNodeProp(node, "description");
-            String description = descriptionProperty.getValue();
+            String description = node.toString();
+            if (descriptionProperty != null) {
+                description = descriptionProperty.getValue();
+            }
             NodeJsonBean nodeBean = new NodeJsonBean();
             nodeBean.setNodeId(node.getNodeIDString());
             nodeBean.setNodeType(node.getType());
@@ -860,4 +866,4 @@ public class Devices implements IDaylightWeb {
         return "forward:" + "/";
     }
 
-}
\ No newline at end of file
+}