You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2026/06/26 19:19:53 UTC
(tomcat) branch 10.1.x updated: Avoid IDE warning for NPE
This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 e0d7b54401 Avoid IDE warning for NPE
e0d7b54401 is described below
commit e0d7b544019fbd2f7e4998545c4a13a8be67a191
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jun 26 20:19:35 2026 +0100
Avoid IDE warning for NPE
---
java/org/apache/catalina/mbeans/ContainerMBean.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/mbeans/ContainerMBean.java b/java/org/apache/catalina/mbeans/ContainerMBean.java
index 0e900a9c4e..d64b4b9f64 100644
--- a/java/org/apache/catalina/mbeans/ContainerMBean.java
+++ b/java/org/apache/catalina/mbeans/ContainerMBean.java
@@ -85,7 +85,9 @@ public class ContainerMBean extends BaseCatalinaMBean<ContainerBase> {
contained.init();
} catch (LifecycleException e) {
// If init fails, try to cleanup since the MBean may not have been added
- container.removeChild(contained);
+ if (container != null) {
+ container.removeChild(contained);
+ }
throw new MBeanException(e);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org