From fca5497f658435b2f4bfae6801dda866ae291e85 Mon Sep 17 00:00:00 2001 From: Tharsanan1 Date: Mon, 4 Mar 2024 11:40:27 +0530 Subject: [PATCH] Fix bug --- .../org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java index c6e263962..4b46115c1 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/JWTAuthenticator.java @@ -530,9 +530,12 @@ private Boolean isJWTExpired(JWTValidationInfo payload) { * * @param list1 The first list to check. * @param list2 The second list to check against. - * @return true if at least one element from list1 exists in list2, otherwise false. + * @return true if list1 is empty else if at least one element from list1 exists in list2, otherwise false. */ public static boolean checkAnyExist(List list1, List list2) { + if (list1.size() == 0) { + return true; + } return list1.stream().anyMatch(list2::contains); } }