James Moger
2013-01-13 9727511ad07db2c332f164fe399108768457bdae
Null checks when generating a fork network (issue-187)
2 files modified
15 ■■■■ changed files
docs/04_releases.mkd 1 ●●●● patch | view | raw | blame | history
src/com/gitblit/GitBlit.java 14 ●●●● patch | view | raw | blame | history
docs/04_releases.mkd
@@ -7,6 +7,7 @@
#### fixes
- Fixed nullpointer on recursively calculating folder sizes when there is a named pipe or symlink in the hierarchy
- Added nullchecking when concurrently forking a repository and trying to display it's fork network (issue-187)
- 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)
- Fixed nullpointer on creating a repository with mixed case (issue 185)
- Fixed nullpointer when using web.allowForking = true && git.cacheRepositoryList = false (issue 182)
src/com/gitblit/GitBlit.java
@@ -1872,11 +1872,16 @@
    
    private ForkModel getForkModelFromCache(String repository) {
        RepositoryModel model = repositoryListCache.get(repository.toLowerCase());
        if (model == null) {
            return null;
        }
        ForkModel fork = new ForkModel(model);
        if (!ArrayUtils.isEmpty(model.forks)) {
            for (String aFork : model.forks) {
                ForkModel fm = getForkModelFromCache(aFork);
                fork.forks.add(fm);
                if (fm != null) {
                    fork.forks.add(fm);
                }
            }
        }
        return fork;
@@ -1884,11 +1889,16 @@
    
    private ForkModel getForkModel(String repository) {
        RepositoryModel model = getRepositoryModel(repository.toLowerCase());
        if (model == null) {
            return null;
        }
        ForkModel fork = new ForkModel(model);
        if (!ArrayUtils.isEmpty(model.forks)) {
            for (String aFork : model.forks) {
                ForkModel fm = getForkModel(aFork);
                fork.forks.add(fm);
                if (fm != null) {
                    fork.forks.add(fm);
                }
            }
        }
        return fork;