From 8ce20038511fb23bccf8891a3df0e777c92f0bd9 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Thu, 16 Jul 2020 20:38:14 +0200 Subject: [PATCH] [tibber] Partial revert of PR 8033 (#8071) Related to #8027 Signed-off-by: Laurent Garnier Signed-off-by: MPH80 --- .../binding/tibber/internal/handler/TibberHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.tibber/src/main/java/org/openhab/binding/tibber/internal/handler/TibberHandler.java b/bundles/org.openhab.binding.tibber/src/main/java/org/openhab/binding/tibber/internal/handler/TibberHandler.java index 7317b5f89e35b..2bdc03723384b 100755 --- a/bundles/org.openhab.binding.tibber/src/main/java/org/openhab/binding/tibber/internal/handler/TibberHandler.java +++ b/bundles/org.openhab.binding.tibber/src/main/java/org/openhab/binding/tibber/internal/handler/TibberHandler.java @@ -356,10 +356,12 @@ public void close() { this.session = null; this.socket = null; } + Future sessionFuture = this.sessionFuture; if (sessionFuture != null && !sessionFuture.isDone()) { sessionFuture.cancel(true); } - if (client != null && client.isStarted()) { + WebSocketClient client = this.client; + if (client != null) { try { client.stop(); } catch (Exception e) {