Skip to content

Commit 320d93a

Browse files
committed
Fix NPE in Result.fromString when string is null [JENKINS-39044]
1 parent 1366fa9 commit 320d93a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/java/hudson/model/Result.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ public boolean isCompleteBuild() {
169169
return name;
170170
}
171171

172-
public static @NonNull Result fromString(@NonNull String s) {
172+
public static @NonNull Result fromString(String s) {
173+
if (s == null) return FAILURE;
173174
for (Result r : all)
174175
if (s.equalsIgnoreCase(r.name))
175176
return r;

0 commit comments

Comments
 (0)