]> git.basschouten.com Git - openhab-addons.git/commitdiff
[mqtt.generic] Fix re-subscribing on new connection (#8920)
authorJochen Klein <git@jochen.susca.de>
Sat, 31 Oct 2020 23:57:34 +0000 (00:57 +0100)
committerGitHub <noreply@github.com>
Sat, 31 Oct 2020 23:57:34 +0000 (16:57 -0700)
Signed-off-by: Jochen Klein <git@jochen.susca.de>
bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java

index f7706a1534b4b7a65bd8137fe653b4f5b4367766..7cbe61922ad4cf9539955c5230dc90de0e81388d 100644 (file)
@@ -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;