commit | c127deae4aa989e0be677ed554909b67c6f885e8 | [log] [tgz] |
---|---|---|
author | Valentin Valchev <vvalchev@apache.org> | Wed Apr 03 13:34:00 2013 +0000 |
committer | Valentin Valchev <vvalchev@apache.org> | Wed Apr 03 13:34:00 2013 +0000 |
tree | 9c3170033545d8d69ecff844e1824f1c07e3a2e6 | |
parent | eb3b05bdcd0f237a32ba3e22c818e03dfb7e200a [diff] |
Fixed FELIX-4012 Sometimes the UPnP plugin fails to start due to device being removed from network https://issues.apache.org/jira/browse/FELIX-4012 git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1464003 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 95a9f4f..c638cbc 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
@@ -540,7 +540,13 @@ { UPnPDevice device = (UPnPDevice) bc.getService(ref); - UPnPIcon[] _icons = device == null ? null : device.getIcons(null); + UPnPIcon[] _icons = null; + try // Fix for FELIX-4012 + { + _icons = device == null ? null : device.getIcons(null); + } catch(IllegalStateException e) { // since OSGi r4.3 + device = null; // don't track that device, it has been removed + } if (_icons != null && _icons.length > 0) { icons.put(ref.getProperty(UPnPDevice.UDN), _icons[0]);