From: markt Date: Mon, 21 Sep 2009 11:02:27 +0000 (+0000) Subject: Fix possible NPE when embedded X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e0977ffa762181ec0e49c86c2dee31454060cc62;p=tomcat7.0 Fix possible NPE when embedded git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@817204 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java index 3f0346455..97f3951c6 100644 --- a/java/org/apache/catalina/startup/ContextConfig.java +++ b/java/org/apache/catalina/startup/ContextConfig.java @@ -1191,9 +1191,14 @@ public class ContextConfig 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;