From 2546ea31eb8cc9b313db921bf8f7555406610d70 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 17 Apr 2014 22:16:42 -0400 Subject: [PATCH] [findbugs] Fix potential NPE on determining hasOrigin on loading a model --- src/main/java/com/gitblit/manager/RepositoryManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()) { -- 2.39.5