[avmfritz] Fix NPE when Fritz!Box sends empty alert state element (<state/>) (#15479)
Signed-off-by: Ulrich Mertin <mail@ulrich-mertin.de>pull/15445/head
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