]> source.dussan.org Git - gitblit.git/commitdiff
Account for null real path from servlet container (issue 67)
authorJames Moger <james.moger@gitblit.com>
Thu, 23 Feb 2012 13:00:19 +0000 (08:00 -0500)
committerJames Moger <james.moger@gitblit.com>
Thu, 23 Feb 2012 13:00:19 +0000 (08:00 -0500)
src/com/gitblit/GitBlit.java

index 9c1cd40fe008cfb3de20f6b69ad6d8845f4f5153..7fb325c6e6a3bee0ef2e91d54a02fe1dc3cfa36d 100644 (file)
@@ -1838,14 +1838,18 @@ public class GitBlit implements ServletContextListener {
                        WebXmlSettings webxmlSettings = new WebXmlSettings(context);\r
 \r
                        // 0.7.0 web.properties in the deployed war folder\r
-                       File overrideFile = new File(context.getRealPath("/WEB-INF/web.properties"));\r
-                       if (overrideFile.exists()) {\r
-                               webxmlSettings.applyOverrides(overrideFile);\r
+                       String webProps = context.getRealPath("/WEB-INF/web.properties");\r
+                       if (!StringUtils.isEmpty(webProps)) {\r
+                               File overrideFile = new File(webProps);\r
+                               if (overrideFile.exists()) {\r
+                                       webxmlSettings.applyOverrides(overrideFile);\r
+                               }\r
                        }\r
+                       \r
 \r
                        // 0.8.0 gitblit.properties file located outside the deployed war\r
                        // folder lie, for example, on RedHat OpenShift.\r
-                       overrideFile = getFileOrFolder("gitblit.properties");\r
+                       File overrideFile = getFileOrFolder("gitblit.properties");\r
                        if (!overrideFile.getPath().equals("gitblit.properties")) {\r
                                webxmlSettings.applyOverrides(overrideFile);\r
                        }\r