Skip to content

Commit

Permalink
Merge pull request #5259 from janakamarasena/api-auth-poc
Browse files Browse the repository at this point in the history
Fix possible NPE
  • Loading branch information
janakamarasena authored Dec 2, 2023
2 parents 0a19a08 + aece84f commit 1c4bad9
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,13 +526,15 @@ protected void setAuthenticator(ApplicationAuthenticator authenticator) {

private static String[] getTags(ApplicationAuthenticator authenticator) {

String[] existingTags = authenticator.getTags();
String[] tags = new String[existingTags.length + 1];
System.arraycopy(existingTags, 0, tags, 0, existingTags.length);
if (authenticator.isAPIBasedAuthenticationSupported()) {
tags[tags.length - 1] = API_AUTH;
if (authenticator == null) {
return new String[0];
}
return tags;
List<String> tagList = new ArrayList<>();
if (authenticator.getTags() != null) {
Collections.addAll(tagList, authenticator.getTags());
}
tagList.add(API_AUTH);
return tagList.toArray(new String[0]);
}

@Reference(
Expand Down

0 comments on commit 1c4bad9

Please sign in to comment.