Skip to content

Commit

Permalink
[FIXED JENKINS-50795] Add null safety checks to FixedSet
Browse files Browse the repository at this point in the history
  • Loading branch information
slgriff committed Sep 8, 2018
1 parent 2652a1b commit 4a16671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/search/FixedSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void find(String token, List<SearchItem> result) {
boolean caseInsensitive = UserSearchProperty.isCaseInsensitive();
for (SearchItem i : items) {
String name = i.getSearchName();
if (name.equals(token) || (caseInsensitive && name.equalsIgnoreCase(token))) {
if (name != null && (name.equals(token) || (caseInsensitive && name.equalsIgnoreCase(token)))) {
result.add(i);
}
}
Expand All @@ -60,7 +60,7 @@ public void suggest(String token, List<SearchItem> result) {
boolean caseInsensitive = UserSearchProperty.isCaseInsensitive();
for (SearchItem i : items) {
String name = i.getSearchName();
if (name.contains(token) || (caseInsensitive && StringUtils.containsIgnoreCase(name, token))) {
if (name != null && (name.contains(token) || (caseInsensitive && StringUtils.containsIgnoreCase(name, token)))) {
result.add(i);
}
}
Expand Down

0 comments on commit 4a16671

Please sign in to comment.