This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 698ccda9fbe1c9dfd4f8d2d13958ba80acfc3a3b
Author: David Blevins <dblev...@tomitribe.com>
AuthorDate: Wed Aug 31 16:17:33 2022 -0700

    Fix NPE when there are no public keys specified
---
 .../apache/tomee/microprofile/jwt/config/JWTAuthConfiguration.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfiguration.java
 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfiguration.java
index eec7fc4180..930e9d7f23 100644
--- 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfiguration.java
+++ 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfiguration.java
@@ -49,7 +49,9 @@ public class JWTAuthConfiguration {
     }
 
     private JWTAuthConfiguration(final Map<String, Key> publicKeys, final 
String issuer, final boolean allowNoExpiryClaim, final String[] audiences) {
-        if (publicKeys.size() == 1) {
+        if (publicKeys == null) {
+            this.publicKeys = Collections.EMPTY_MAP;
+        } else if (publicKeys.size() == 1) {
             final Key singleKey = publicKeys.values().iterator().next();
             this.publicKeys = Collections.singletonMap(DEFAULT_KEY, singleKey);
         } else {

Reply via email to