From dd584779dbb430a8010a6ff11106f304f3f8c180 Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Sat, 14 Jan 2023 11:30:06 +0100 Subject: [PATCH] Improve UPNP callback removal (#3310) Signed-off-by: Jacob Laursen --- .../core/io/transport/upnp/internal/UpnpIOServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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());