Merge "Avoid NPE in get related changes" into stable-2.11

This commit is contained in:
David Pursehouse 2015-07-02 12:36:28 +00:00 committed by Gerrit Code Review
commit 4318e68ef6

View File

@ -116,7 +116,10 @@ public class GetRelated implements RestReadView<RevisionResource> {
PatchSet p = commits.get(c.name()); PatchSet p = commits.get(c.name());
Change g = null; Change g = null;
if (p != null) { if (p != null) {
g = changes.get(p.getId().getParentKey()).change(); ChangeData cd = changes.get(p.getId().getParentKey());
if (cd != null) {
g = cd.change();
}
added.add(p.getId().getParentKey()); added.add(p.getId().getParentKey());
} }
parents.add(new ChangeAndCommit(g, p, c)); parents.add(new ChangeAndCommit(g, p, c));