fixed a small problem with unregistering the listener

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@929495 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/SessionObject.java b/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/SessionObject.java
index c64cce0..402dfab 100644
--- a/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/SessionObject.java
+++ b/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/SessionObject.java
@@ -128,7 +128,18 @@
         vars.clear();

         if (reg != null)

         {

-            reg.unregister();

+            try

+            {

+                reg.unregister();

+            }

+            catch (Throwable t)

+            {

+                // When the bundle is stopped, the session object might remain hanging

+                // in the session, until it expires. After being stopped, the framework

+                // however will automatically destroy the registration. But after session

+                // expires this method will be called once again and will try to 

+                // unregister the service. This will throw exception, that should be caught.

+            }

             reg = null;

         }

         return this;