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 2009/09/21 13:02:31 UTC

svn commit: r817204 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

Author: markt
Date: Mon Sep 21 11:02:27 2009
New Revision: 817204

URL: http://svn.apache.org/viewvc?rev=817204&view=rev
Log:
Fix possible NPE when embedded

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=817204&r1=817203&r2=817204&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Sep 21 11:02:27 2009
@@ -1191,9 +1191,14 @@
     protected InputSource getHostWebXmlSource() {
         String resourceName = getHostConfigPath(Constants.HostWebXml);
         
+        // In an embedded environment, configBase might not be set
+        File configBase = getConfigBase();
+        if (configBase == null)
+            return null;
+        
         String basePath = null;
         try {
-            basePath = getConfigBase().getCanonicalPath();
+            basePath = configBase.getCanonicalPath();
         } catch (IOException e) {
             log.error(sm.getString("contectConfig.baseError"), e);
             return null;



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