Skip to content

Commit

Permalink
Fix integration test failures by handling a NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Naduni Pamudika committed Jan 3, 2025
1 parent f78fbae commit 913e355
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5055,14 +5055,16 @@ public static Set<String> extractVisibleEnvironmentsForUser(List<Environment> en
String[] permittedRoles = environment.getVisibilityRoles();
if (permittedRoles != null && permittedRoles[0].equals("all")) {
environmentStringSet.add(environment.toString());
} else {
} else if (permittedRoles != null) {
for (String role : userRoles) {
for (String permission : permittedRoles) {
if (role.equals(permission)) {
environmentStringSet.add(environment.toString());
}
}
}
} else {
environmentStringSet.add(environment.toString());
}
}
}
Expand Down

0 comments on commit 913e355

Please sign in to comment.