From: Madhu Venugopal Date: Thu, 7 Nov 2013 23:05:46 +0000 (-0800) Subject: Fixing a couple of NPE in the newly added Connection Manager UI. X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~462 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=20bd54c0c63f16541a0ab907165a7ea2d6165442 Fixing a couple of NPE in the newly added Connection Manager UI. Change-Id: Ib0904df810b5dbab8e8642d2650d58b63d28bec1 Signed-off-by: Madhu Venugopal --- 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 +}