Skip to content

Commit

Permalink
Avoid NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Jan 24, 2025
1 parent 2055cec commit 7776820
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ public void filter(ContainerRequestContext requestContext) throws IOException {

@ManagedAttribute
public String getForUser() {
return forUser.pattern();
return forUser == null ? null : forUser.pattern();
}

@ManagedAttribute
public void setForUser(String pattern) {
this.forUser = Pattern.compile(pattern);
if (MBeans.isBlank(pattern)) {
this.forUser = null;
} else {
this.forUser = Pattern.compile(pattern);
}
}

@ManagedAttribute
Expand Down

0 comments on commit 7776820

Please sign in to comment.