diff options
author | James Moger <james.moger@gitblit.com> | 2015-11-18 09:19:23 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2015-11-18 09:19:23 -0500 |
commit | def01db5f7dc1c607026528eed1dfd75c6e59779 (patch) | |
tree | cab9723080b64ec3c5399854417b1202fcbf5b2d /src/main/java/com/gitblit/manager/RepositoryManager.java | |
parent | 6069be20b5ebb786a1b890fa9c91350ffd355b0f (diff) | |
download | gitblit-def01db5f7dc1c607026528eed1dfd75c6e59779.tar.gz gitblit-def01db5f7dc1c607026528eed1dfd75c6e59779.zip |
Catch some potential NPEs
Diffstat (limited to 'src/main/java/com/gitblit/manager/RepositoryManager.java')
-rw-r--r-- | src/main/java/com/gitblit/manager/RepositoryManager.java | 7 |
1 files changed, 7 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; |