tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r817204 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
Date Mon, 21 Sep 2009 11:02:31 GMT
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


Mime
View raw message