diff --git a/bundles/org.openhab.core.io.transport.upnp/src/main/java/org/openhab/core/io/transport/upnp/internal/UpnpIOServiceImpl.java b/bundles/org.openhab.core.io.transport.upnp/src/main/java/org/openhab/core/io/transport/upnp/internal/UpnpIOServiceImpl.java index a6c31e442..c5143322e 100644 --- a/bundles/org.openhab.core.io.transport.upnp/src/main/java/org/openhab/core/io/transport/upnp/internal/UpnpIOServiceImpl.java +++ b/bundles/org.openhab.core.io.transport.upnp/src/main/java/org/openhab/core/io/transport/upnp/internal/UpnpIOServiceImpl.java @@ -269,11 +269,10 @@ public class UpnpIOServiceImpl implements UpnpIOService, RegistryListener { logger.trace("Removing an UPNP service subscription '{}' for particpant '{}'", serviceID, participant.getUDN()); - UpnpSubscriptionCallback callback = subscriptionCallbacks.get(subService); + UpnpSubscriptionCallback callback = subscriptionCallbacks.remove(subService); if (callback != null) { callback.end(); } - subscriptionCallbacks.remove(subService); } else { logger.trace("Could not find service '{}' for device '{}'", serviceID, device.getIdentity().getUdn());