From: Jochen Klein Date: Sat, 31 Oct 2020 23:57:34 +0000 (+0100) Subject: [mqtt.generic] Fix re-subscribing on new connection (#8920) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=ddb5f9a3bf2e3bc487b9b66c749b2a96e7e766d4;p=openhab-addons.git [mqtt.generic] Fix re-subscribing on new connection (#8920) Signed-off-by: Jochen Klein --- 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;