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

rmaucher pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 378297e26a Null checks
378297e26a is described below

commit 378297e26ae96879541f86cb2c14bce808d4bcde
Author: remm <[email protected]>
AuthorDate: Thu May 21 16:39:56 2026 +0200

    Null checks
---
 java/jakarta/security/auth/message/config/AuthConfigFactory.java | 3 ++-
 java/org/apache/catalina/deploy/NamingResourcesImpl.java         | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/jakarta/security/auth/message/config/AuthConfigFactory.java 
b/java/jakarta/security/auth/message/config/AuthConfigFactory.java
index 7d56046cf3..f8b740fde2 100644
--- a/java/jakarta/security/auth/message/config/AuthConfigFactory.java
+++ b/java/jakarta/security/auth/message/config/AuthConfigFactory.java
@@ -72,7 +72,8 @@ public abstract class AuthConfigFactory {
                         factory = (AuthConfigFactory) 
clazz.getConstructor().newInstance();
                     }
                 } catch (ReflectiveOperationException e) {
-                    throw new RuntimeException("AuthConfigFactory error:" + 
e.getCause().getMessage(), e.getCause());
+                    Throwable cause = e.getCause() == null ? e : e.getCause();
+                    throw new RuntimeException("AuthConfigFactory error:" + 
cause.getMessage(), cause);
                 }
             }
         }
diff --git a/java/org/apache/catalina/deploy/NamingResourcesImpl.java 
b/java/org/apache/catalina/deploy/NamingResourcesImpl.java
index 3a9a796ca9..c07f572010 100644
--- a/java/org/apache/catalina/deploy/NamingResourcesImpl.java
+++ b/java/org/apache/catalina/deploy/NamingResourcesImpl.java
@@ -246,6 +246,10 @@ public class NamingResourcesImpl extends 
LifecycleMBeanBase implements Serializa
                 }
             } else if (rl != null) {
                 // Link. Need to look at the global resources
+                Server server = getServer();
+                if (server == null) {
+                    return;
+                }
                 NamingResourcesImpl global = 
getServer().getGlobalNamingResources();
                 if (global.findEnvironment(rl.getGlobal()) != null) {
                     if (global.findEnvironment(rl.getGlobal()).getOverride()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to