From 20bd54c0c63f16541a0ab907165a7ea2d6165442 Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Thu, 7 Nov 2013 15:05:46 -0800 Subject: [PATCH] Fixing a couple of NPE in the newly added Connection Manager UI. Change-Id: Ib0904df810b5dbab8e8642d2650d58b63d28bec1 Signed-off-by: Madhu Venugopal --- .../opendaylight/controller/devices/web/Devices.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java index 91261f6499..3d33edcbf2 100644 --- a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java +++ b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java @@ -751,9 +751,15 @@ public class Devices implements IDaylightWeb { Set nodes = connectionManager.getLocalNodes(); List result = new LinkedList(); + 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 +} -- 2.36.6