summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2015-11-18 09:19:23 -0500
committerJames Moger <james.moger@gitblit.com>2015-11-18 09:19:23 -0500
commitdef01db5f7dc1c607026528eed1dfd75c6e59779 (patch)
treecab9723080b64ec3c5399854417b1202fcbf5b2d /src
parent6069be20b5ebb786a1b890fa9c91350ffd355b0f (diff)
downloadgitblit-def01db5f7dc1c607026528eed1dfd75c6e59779.tar.gz
gitblit-def01db5f7dc1c607026528eed1dfd75c6e59779.zip
Catch some potential NPEs
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/manager/RepositoryManager.java7
-rw-r--r--src/main/java/com/gitblit/wicket/pages/ForksPage.java3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java
index 027ba23b..e2e4de68 100644
--- a/src/main/java/com/gitblit/manager/RepositoryManager.java
+++ b/src/main/java/com/gitblit/manager/RepositoryManager.java
@@ -1113,9 +1113,16 @@ public class RepositoryManager implements IRepositoryManager {
// find the root, cached
String key = getRepositoryKey(repository);
RepositoryModel model = repositoryListCache.get(key);
+ if (model == null) {
+ return null;
+ }
+
while (model.originRepository != null) {
String originKey = getRepositoryKey(model.originRepository);
model = repositoryListCache.get(originKey);
+ if (model == null) {
+ return null;
+ }
}
ForkModel root = getForkModelFromCache(model.name);
return root;
diff --git a/src/main/java/com/gitblit/wicket/pages/ForksPage.java b/src/main/java/com/gitblit/wicket/pages/ForksPage.java
index 93fc9faf..045f5f7e 100644
--- a/src/main/java/com/gitblit/wicket/pages/ForksPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/ForksPage.java
@@ -136,6 +136,9 @@ public class ForksPage extends RepositoryPage {
protected List<FlatFork> flatten(ForkModel node, int level) {
List<FlatFork> list = new ArrayList<FlatFork>();
+ if (node == null) {
+ return list;
+ }
list.add(new FlatFork(node.repository, level));
if (!node.isLeaf()) {
for (ForkModel fork : node.forks) {