Author: markt Date: Tue May 14 21:36:08 2013 New Revision: 1482602 URL: http://svn.apache.org/r1482602 Log: Avoid NPEs when attempting to destroy contexts that failed to start.
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1482602&r1=1482601&r2=1482602&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Tue May 14 21:36:08 2013 @@ -5755,7 +5755,7 @@ public class StandardContext extends Con ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); - if (getLoader().getClassLoader() != null) { + if (getLoader() != null && getLoader().getClassLoader() != null) { Thread.currentThread().setContextClassLoader (getLoader().getClassLoader()); } Modified: tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java?rev=1482602&r1=1482601&r2=1482602&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java (original) +++ tomcat/trunk/java/org/apache/catalina/webresources/StandardRoot.java Tue May 14 21:36:08 2013 @@ -486,7 +486,9 @@ public class StandardRoot extends Lifecy } } - main.destroy(); + if (main != null) { + main.destroy(); + } mainResources.clear(); for (WebResourceSet webResourceSet : jarResources) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org