diff options
author | James Moger <james.moger@gitblit.com> | 2013-09-23 09:51:45 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-09-23 09:51:45 -0400 |
commit | 288d6cc169706607601f185505fca50f9950c30b (patch) | |
tree | 6d7e50d39d5e6c52222e1abed7d89bb808e9645a /src/main/java/com/gitblit/GitBlit.java | |
parent | 2a8ea034b63736708839c140e53121026c19b9a8 (diff) | |
download | gitblit-288d6cc169706607601f185505fca50f9950c30b.tar.gz gitblit-288d6cc169706607601f185505fca50f9950c30b.zip |
Fix potential NPE in setting shared permissions
Diffstat (limited to 'src/main/java/com/gitblit/GitBlit.java')
-rw-r--r-- | src/main/java/com/gitblit/GitBlit.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java index 95da669e..2cebe82b 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -2534,16 +2534,16 @@ public class GitBlit implements ServletContextListener { } } + // Adjust permissions in case we updated the config files + JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "config"), + getString(Keys.git.createRepositoriesShared, "FALSE")); + JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "HEAD"), + getString(Keys.git.createRepositoriesShared, "FALSE")); + // close the repository object r.close(); } - // Adjust permissions in case we updated the config files - JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "config"), - getString(Keys.git.createRepositoriesShared, "FALSE")); - JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "HEAD"), - getString(Keys.git.createRepositoriesShared, "FALSE")); - // update repository cache removeFromCachedRepositoryList(repositoryName); // model will actually be replaced on next load because config is stale |