Skip to content

Commit 4ffbc6d

Browse files
committed
Alarm 'enabled state' NPE fix
enabled_date may be null, and alarm table checking value updates via hash code would then run into NullPointerException
1 parent a56058b commit 4ffbc6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/alarm/model/src/main/java/org/phoebus/applications/alarm/model/EnabledState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public int hashCode()
5454
{
5555
final int prime = 31;
5656
final int enabled_check = this.enabled ? 1 : 0;
57-
int result = enabled_date.hashCode();
57+
int result = enabled_date == null ? 0 : enabled_date.hashCode();
5858
result = prime * result + enabled_check;
5959
return result;
6060
}

0 commit comments

Comments
 (0)