Skip to content

Commit

Permalink
Prevent NPE on specific disconnect situations
Browse files Browse the repository at this point in the history
  • Loading branch information
pfink committed Oct 20, 2016
1 parent 9e9291f commit c4be8f3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/
package org.openhab.binding.flicbutton.handler;

import java.util.Objects;

import org.eclipse.smarthome.core.library.types.OnOffType;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
Expand Down Expand Up @@ -50,7 +52,7 @@ public void initialize() {
void flicConnectionStatusChanged(ConnectionStatus connectionStatus, DisconnectReason disconnectReason) {
if (connectionStatus == ConnectionStatus.Disconnected) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR,
disconnectReason.toString());
"Disconnect Reason: " + Objects.toString(disconnectReason));
} else {
updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, "Button reconnected.");
}
Expand Down

0 comments on commit c4be8f3

Please sign in to comment.