]> source.dussan.org Git - gitblit.git/commitdiff
Null checks when generating a fork network (issue-187)
authorJames Moger <james.moger@gitblit.com>
Sun, 13 Jan 2013 22:28:05 +0000 (17:28 -0500)
committerJames Moger <james.moger@gitblit.com>
Sun, 13 Jan 2013 22:28:18 +0000 (17:28 -0500)
docs/04_releases.mkd
src/com/gitblit/GitBlit.java

index 3d17a9b29ec64f2ad35ca8beaccb4f52fcabd8f5..af702f2c73f45c8e5bda530cafd56e102a3f636c 100644 (file)
@@ -7,6 +7,7 @@
 #### fixes\r
 \r
 - Fixed nullpointer on recursively calculating folder sizes when there is a named pipe or symlink in the hierarchy\r
+- Added nullchecking when concurrently forking a repository and trying to display it's fork network (issue-187)\r
 - Fixed bug where permission changes were not visible in the web ui to a logged-in user until the user logged-out and then logged back in again (issue-186)\r
 - Fixed nullpointer on creating a repository with mixed case (issue 185)\r
 - Fixed nullpointer when using web.allowForking = true && git.cacheRepositoryList = false (issue 182)\r
index f417b3eb8707b3402be3b30b691c83fee66983f4..e3ecebd839dff4149c2687f9a6d4d9e15d72d5b0 100644 (file)
@@ -1872,11 +1872,16 @@ public class GitBlit implements ServletContextListener {
        \r
        private ForkModel getForkModelFromCache(String repository) {\r
                RepositoryModel model = repositoryListCache.get(repository.toLowerCase());\r
+               if (model == null) {\r
+                       return null;\r
+               }\r
                ForkModel fork = new ForkModel(model);\r
                if (!ArrayUtils.isEmpty(model.forks)) {\r
                        for (String aFork : model.forks) {\r
                                ForkModel fm = getForkModelFromCache(aFork);\r
-                               fork.forks.add(fm);\r
+                               if (fm != null) {\r
+                                       fork.forks.add(fm);\r
+                               }\r
                        }\r
                }\r
                return fork;\r
@@ -1884,11 +1889,16 @@ public class GitBlit implements ServletContextListener {
        \r
        private ForkModel getForkModel(String repository) {\r
                RepositoryModel model = getRepositoryModel(repository.toLowerCase());\r
+               if (model == null) {\r
+                       return null;\r
+               }\r
                ForkModel fork = new ForkModel(model);\r
                if (!ArrayUtils.isEmpty(model.forks)) {\r
                        for (String aFork : model.forks) {\r
                                ForkModel fm = getForkModel(aFork);\r
-                               fork.forks.add(fm);\r
+                               if (fm != null) {\r
+                                       fork.forks.add(fm);\r
+                               }\r
                        }\r
                }\r
                return fork;\r