Skip to content

Commit

Permalink
fix(account): Provide defaults to avoid NPEs
Browse files Browse the repository at this point in the history
An account without requiredGroupMembership or permissions is a
valid account. However, certain areas of the code assume that these
values are not null and therefore encounter NullPointerExceptions.
To avoid this, initialize these fields to a reasonable default value.
  • Loading branch information
Daniel Zheng committed May 15, 2024
1 parent 5093402 commit 8aa8de4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public static class Account implements AccessControlledAccountDefinition {
@Include private Boolean enabled;
@Include private List<CredentialsConfig.Region> regions;
@Include private List<String> defaultSecurityGroups;
private List<String> requiredGroupMembership;
@Include private Permissions.Builder permissions;
private List<String> requiredGroupMembership = new ArrayList<>();
@Include private Permissions.Builder permissions = new Permissions.Builder();
@Include private String edda;
@Include private Boolean eddaEnabled;
@Include private Boolean lambdaEnabled;
Expand Down

0 comments on commit 8aa8de4

Please sign in to comment.