Merge "Fix NPE in /projects/{name}/children?recursive when a parent is missing" into stable-2.9
This commit is contained in:
commit
b8bb7c1109
@ -25,6 +25,7 @@ import com.google.inject.Inject;
|
||||
|
||||
import org.kohsuke.args4j.Option;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -94,7 +95,13 @@ public class ListChildProjects implements RestReadView<ProjectResource> {
|
||||
node.addChild(key);
|
||||
}
|
||||
}
|
||||
return getChildProjectsRecursively(projects.get(parent));
|
||||
|
||||
ProjectNode n = projects.get(parent);
|
||||
if (n != null) {
|
||||
return getChildProjectsRecursively(n);
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
private List<ProjectInfo> getChildProjectsRecursively(ProjectNode p) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user