Catch some potential NPEs
| | |
| | | // 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; |
| | |
| | |
|
| | | 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) {
|