// 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;
\r
protected List<FlatFork> flatten(ForkModel node, int level) {\r
List<FlatFork> list = new ArrayList<FlatFork>();\r
+ if (node == null) {\r
+ return list;\r
+ }\r
list.add(new FlatFork(node.repository, level));\r
if (!node.isLeaf()) {\r
for (ForkModel fork : node.forks) {\r