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

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


The following commit(s) were added to refs/heads/main by this push:
     new 4270673737 Fix possible NPE
4270673737 is described below

commit 427067373749c43960eacb2673c6e9377309bd3e
Author: remm <r...@apache.org>
AuthorDate: Thu Sep 14 11:19:06 2023 +0200

    Fix possible NPE
    
    Found by coverity.
---
 java/org/apache/catalina/startup/Tomcat.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/java/org/apache/catalina/startup/Tomcat.java 
b/java/org/apache/catalina/startup/Tomcat.java
index 08e8c0381d..85f8700078 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -383,6 +383,9 @@ public class Tomcat {
                                       String servletClass) {
         // will do class for name and set init params
         Wrapper sw = ctx.createWrapper();
+        if (sw == null) {
+            return null;
+        }
         sw.setServletClass(servletClass);
         sw.setName(servletName);
         ctx.addChild(sw);


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

Reply via email to