This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 6bcb00bec7 Avoid IDE warning for NPE
6bcb00bec7 is described below
commit 6bcb00bec7a29e344127f3c0daf68619148359a4
Author: Mark Thomas <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]