Skip to content

Commit

Permalink
[avmfritz] Fix NPE when Fritz!Box sends empty alert state element (<s…
Browse files Browse the repository at this point in the history
…tate/>) (openhab#15479)

Signed-off-by: Ulrich Mertin <mail@ulrich-mertin.de>
  • Loading branch information
quidam authored Sep 2, 2023
1 parent b9a0e6f commit 38d45ca
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public void setState(BigDecimal state) {
}

public boolean hasObstructionAlarmOccurred() {
return (state.intValue() & 1) != 0;
return state != null && (state.intValue() & 1) != 0;
}

public boolean hasTemperaturAlarmOccurred() {
return (state.intValue() & 2) != 0;
return state != null && (state.intValue() & 2) != 0;
}

public boolean hasUnknownAlarmOccurred() {
return ((state.intValue() & 255) >> 2) != 0;
return state != null && ((state.intValue() & 255) >> 2) != 0;
}

@Override
Expand Down

0 comments on commit 38d45ca

Please sign in to comment.