Robin Rosenberg
2013-09-01 02ede7f11c6fb28ca53fc240905cd1b140236f08
Avoid NPE when the default branch cannot be identified

This is a normal condition that complicates debugging, i.e.
when catching all NPE's.
1 files modified
2 ■■■■■ changed files
src/main/java/com/gitblit/utils/JGitUtils.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/utils/JGitUtils.java
@@ -566,6 +566,8 @@
        try {
            if (tree == null) {
                ObjectId object = getDefaultBranch(repository);
                if (object == null)
                    return null;
                RevCommit commit = rw.parseCommit(object);
                tree = commit.getTree();
            }