Merge "add null check to patchset object while creating descendent changes." into stable-2.6
This commit is contained in:
@@ -188,11 +188,24 @@ public class EventFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final RevId revId = db.patchSets().get(psId).getRevision();
|
final PatchSet ps = db.patchSets().get(psId);
|
||||||
for (PatchSetAncestor a : db.patchSetAncestors().descendantsOf(revId)) {
|
if (ps == null) {
|
||||||
final PatchSet p = db.patchSets().get(a.getPatchSet());
|
log.error("Error while generating the list of descendants for"
|
||||||
final Change c = db.changes().get(p.getId().getParentKey());
|
+ " PatchSet " + psId + ": Cannot find PatchSet entry in"
|
||||||
ca.neededBy.add(newNeededBy(c, p));
|
+ " database.");
|
||||||
|
} else {
|
||||||
|
final RevId revId = ps.getRevision();
|
||||||
|
for (PatchSetAncestor a : db.patchSetAncestors().descendantsOf(revId)) {
|
||||||
|
final PatchSet p = db.patchSets().get(a.getPatchSet());
|
||||||
|
if (p == null) {
|
||||||
|
log.error("Error while generating the list of descendants for"
|
||||||
|
+ " revision " + revId.get() + ": Cannot find PatchSet entry in"
|
||||||
|
+ " database for " + a.getPatchSet());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
final Change c = db.changes().get(p.getId().getParentKey());
|
||||||
|
ca.neededBy.add(newNeededBy(c, p));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
db.close();
|
db.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user