Skip to content

Commit

Permalink
returning when the connection is offline since following code won't work
Browse files Browse the repository at this point in the history
either.

Signed-off-by: Wouter Denayer <[email protected]>
  • Loading branch information
Wouter Denayer committed Jan 3, 2021
1 parent 8b5fde7 commit 8021ce1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ private void refresh() {
List<Thing> things = getThing().getThings().stream()
.filter(thing -> thing.getHandler() instanceof NikobusModuleHandler).collect(Collectors.toList());

// if there are command listeners then we need an open connection even if no modules exist
// if there are command listeners (buttons) then we need an open connection even if no modules exist
if (!commandListeners.isEmpty()) {
NikobusConnection connection = this.connection;
if (connection == null) {
Expand All @@ -340,6 +340,7 @@ private void refresh() {
} catch (IOException e) {
connection.close();
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
return;
}
}

Expand Down

0 comments on commit 8021ce1

Please sign in to comment.