Fixed FELIX-3595 NPE in ControlServlet.addingService
https://issues.apache.org/jira/browse/FELIX-3595

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1360693 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java b/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
index 267e487..cf7cdb3 100644
--- a/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
+++ b/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java
@@ -530,7 +530,7 @@
     {

         UPnPDevice device = (UPnPDevice) bc.getService(ref);

 

-        UPnPIcon[] _icons = device.getIcons(null);

+        UPnPIcon[] _icons = device == null ? null : device.getIcons(null);

         if (_icons != null && _icons.length > 0)

         {

             icons.put(ref.getProperty(UPnPDevice.UDN), _icons[0]);