You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/05/26 09:08:24 UTC

(tomcat) branch 10.1.x updated: Fix NPE

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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 871edb1233 Fix NPE
871edb1233 is described below

commit 871edb1233e991da8a2fe4e313b6781229fa9776
Author: remm <re...@apache.org>
AuthorDate: Tue May 26 10:29:24 2026 +0200

    Fix NPE
---
 java/org/apache/catalina/startup/Tomcat.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java
index 9d444f83f6..cd816c3716 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -690,7 +690,7 @@ public class Tomcat {
     public Context addWebapp(Host host, String contextPath, String docBase) {
         LifecycleListener listener;
         try {
-            Class<?> clazz = Class.forName(host.getConfigClass());
+            Class<?> clazz = Class.forName((host != null ? host : getHost()).getConfigClass());
             listener = (LifecycleListener) clazz.getConstructor().newInstance();
         } catch (ReflectiveOperationException e) {
             // Wrap in IAE since we can't easily change the method signature


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org