diff options
author | James Moger <james.moger@gitblit.com> | 2014-04-17 22:16:42 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-17 23:08:07 -0400 |
commit | 2546ea31eb8cc9b313db921bf8f7555406610d70 (patch) | |
tree | fce90e45a6f28f7a090474282e504c0959111ca6 | |
parent | 1d78b8b372f15d89f10fd32cb0227a6a7966de3c (diff) | |
download | gitblit-2546ea31eb8cc9b313db921bf8f7555406610d70.tar.gz gitblit-2546ea31eb8cc9b313db921bf8f7555406610d70.zip |
[findbugs] Fix potential NPE on determining hasOrigin on loading a model
-rw-r--r-- | src/main/java/com/gitblit/manager/RepositoryManager.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java index 9741998f..05a90b67 100644 --- a/src/main/java/com/gitblit/manager/RepositoryManager.java +++ b/src/main/java/com/gitblit/manager/RepositoryManager.java @@ -785,10 +785,11 @@ public class RepositoryManager implements IRepositoryManager { model.projectPath = StringUtils.getFirstPathElement(repositoryName); StoredConfig config = r.getConfig(); - boolean hasOrigin = !StringUtils.isEmpty(config.getString("remote", "origin", "url")); + boolean hasOrigin = false; if (config != null) { // Initialize description from description file + hasOrigin = !StringUtils.isEmpty(config.getString("remote", "origin", "url")); if (getConfig(config,"description", null) == null) { File descFile = new File(r.getDirectory(), "description"); if (descFile.exists()) { |