[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() {
|
public boolean hasObstructionAlarmOccurred() {
|
||||||
return (state.intValue() & 1) != 0;
|
return state != null && (state.intValue() & 1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasTemperaturAlarmOccurred() {
|
public boolean hasTemperaturAlarmOccurred() {
|
||||||
return (state.intValue() & 2) != 0;
|
return state != null && (state.intValue() & 2) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasUnknownAlarmOccurred() {
|
public boolean hasUnknownAlarmOccurred() {
|
||||||
return ((state.intValue() & 255) >> 2) != 0;
|
return state != null && ((state.intValue() & 255) >> 2) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user