From: James Moger Date: Fri, 18 Apr 2014 02:16:42 +0000 (-0400) Subject: [findbugs] Fix potential NPE on determining hasOrigin on loading a model X-Git-Tag: v1.5.0~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2546ea31eb8cc9b313db921bf8f7555406610d70;p=gitblit.git [findbugs] Fix potential NPE on determining hasOrigin on loading a model --- 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()) {