Fix lgtm.com alert: potential NPE due to non-short circuit logic
The logical-AND operator '&&' evaluates its operands in order, which is what is required here. The bitwise-AND operator '&' always evaluates all operands, which will in some cases result in a NPE in the second operand. Details: https://lgtm.com/projects/g/keycloak/keycloak/snapshot/dist-7900299-1490802114895/files/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java#V543
This commit is contained in:
parent
eb93eef874
commit
2df1175315
1 changed files with 1 additions and 1 deletions
|
@ -541,7 +541,7 @@ public class RealmAdminResource {
|
|||
query.client(client);
|
||||
}
|
||||
|
||||
if (types != null & !types.isEmpty()) {
|
||||
if (types != null && !types.isEmpty()) {
|
||||
EventType[] t = new EventType[types.size()];
|
||||
for (int i = 0; i < t.length; i++) {
|
||||
t[i] = EventType.valueOf(types.get(i));
|
||||
|
|
Loading…
Reference in a new issue