mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
[avmfritz] Fix NPE when Fritz!Box sends empty alert state element (<state/>) (#15479)
Signed-off-by: Ulrich Mertin <mail@ulrich-mertin.de>
This commit is contained in:
parent
b9a0e6fa14
commit
38d45ca017
@ -42,15 +42,15 @@ public class AlertModel {
|
||||
}
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user