From: James Moger Date: Thu, 23 Feb 2012 13:00:19 +0000 (-0500) Subject: Account for null real path from servlet container (issue 67) X-Git-Tag: v0.9.0~88 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7a1889b343b24aa18ce9440794606f4c08c2741f;p=gitblit.git Account for null real path from servlet container (issue 67) --- diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 9c1cd40f..7fb325c6 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -1838,14 +1838,18 @@ public class GitBlit implements ServletContextListener { WebXmlSettings webxmlSettings = new WebXmlSettings(context); // 0.7.0 web.properties in the deployed war folder - File overrideFile = new File(context.getRealPath("/WEB-INF/web.properties")); - if (overrideFile.exists()) { - webxmlSettings.applyOverrides(overrideFile); + String webProps = context.getRealPath("/WEB-INF/web.properties"); + if (!StringUtils.isEmpty(webProps)) { + File overrideFile = new File(webProps); + if (overrideFile.exists()) { + webxmlSettings.applyOverrides(overrideFile); + } } + // 0.8.0 gitblit.properties file located outside the deployed war // folder lie, for example, on RedHat OpenShift. - overrideFile = getFileOrFolder("gitblit.properties"); + File overrideFile = getFileOrFolder("gitblit.properties"); if (!overrideFile.getPath().equals("gitblit.properties")) { webxmlSettings.applyOverrides(overrideFile); }