Skip to content

Commit

Permalink
Avoid setting value to passed parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
poovamraj committed Nov 29, 2023
1 parent dd6215e commit 4fe7374
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/src/main/java/com/auth0/jwt/JWTVerifier.java
Expand Up @@ -368,10 +368,11 @@ private boolean assertValidAudienceClaim(
List<String> expectedAudience,
boolean shouldContainAll
) {
// normalize to lists if null
actualAudience = actualAudience == null ? Collections.emptyList() : actualAudience;
expectedAudience = expectedAudience == null ? Collections.emptyList() : expectedAudience;

if(actualAudience == null && expectedAudience == null) {
return true;
} else if (actualAudience == null || expectedAudience == null) {
return false;
}
if (shouldContainAll) {
// containsAll([]) always returns true
if (expectedAudience.isEmpty() && !actualAudience.isEmpty()) {
Expand Down

0 comments on commit 4fe7374

Please sign in to comment.