diff options
author | James Moger <james.moger@gitblit.com> | 2012-02-23 08:00:19 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-02-23 08:00:19 -0500 |
commit | 7a1889b343b24aa18ce9440794606f4c08c2741f (patch) | |
tree | 6db16a15eb57c1fa435cb077765b1d52a52a86d0 /src | |
parent | 6c6e7d393119dc31a8a6c407236af10290abc77e (diff) | |
download | gitblit-7a1889b343b24aa18ce9440794606f4c08c2741f.tar.gz gitblit-7a1889b343b24aa18ce9440794606f4c08c2741f.zip |
Account for null real path from servlet container (issue 67)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/gitblit/GitBlit.java | 12 |
1 files changed, 8 insertions, 4 deletions
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);
}
|