James Moger
2012-02-23 7a1889b343b24aa18ce9440794606f4c08c2741f
Account for null real path from servlet container (issue-67)
1 files modified
8 ■■■■ changed files
src/com/gitblit/GitBlit.java 8 ●●●● patch | view | raw | blame | history
src/com/gitblit/GitBlit.java
@@ -1838,14 +1838,18 @@
            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"));
            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);
            }