From ddb5f9a3bf2e3bc487b9b66c749b2a96e7e766d4 Mon Sep 17 00:00:00 2001 From: Jochen Klein Date: Sun, 1 Nov 2020 00:57:34 +0100 Subject: [PATCH] [mqtt.generic] Fix re-subscribing on new connection (#8920) Signed-off-by: Jochen Klein --- .../java/org/openhab/binding/mqtt/generic/ChannelState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java index f7706a1534..7cbe61922a 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java @@ -290,7 +290,7 @@ public class ChannelState implements MqttMessageSubscriber { int timeout) { synchronized (futureLock) { // if the connection is still the same, the subscription is still present, otherwise we need to renew - if (hasSubscribed || !future.isDone() && connection.equals(this.connection)) { + if ((hasSubscribed || !future.isDone()) && connection.equals(this.connection)) { return future; } hasSubscribed = false; -- 2.47.3