]> source.dussan.org Git - gitblit.git/commitdiff
[findbugs] Fix potential NPE on determining hasOrigin on loading a model
authorJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 02:16:42 +0000 (22:16 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 03:08:07 +0000 (23:08 -0400)
src/main/java/com/gitblit/manager/RepositoryManager.java

index 9741998f80cb1bc56422bd3c09903fff141630f1..05a90b67f45c7604eaebd1ad7fcce5dece694eb8 100644 (file)
@@ -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()) {