Skip SubmitRecords that are missing labels
A record cna be missing labels if the change is closed, or the patch set is not the current patch set, etc. Skip these rather than NPE. Change-Id: Iaa5d32ee9a7279a66535c66d3ef6eb05efd3a837
This commit is contained in:
@@ -109,6 +109,9 @@ public class ReviewerJson {
|
|||||||
PatchSet ps = cd.currentPatchSet(db);
|
PatchSet ps = cd.currentPatchSet(db);
|
||||||
if (ps != null) {
|
if (ps != null) {
|
||||||
for (SubmitRecord rec : ctl.canSubmit(db.get(), ps, cd, true, false)) {
|
for (SubmitRecord rec : ctl.canSubmit(db.get(), ps, cd, true, false)) {
|
||||||
|
if (rec.labels == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (SubmitRecord.Label label : rec.labels) {
|
for (SubmitRecord.Label label : rec.labels) {
|
||||||
String name = label.label;
|
String name = label.label;
|
||||||
if (!out.approvals.containsKey(name)
|
if (!out.approvals.containsKey(name)
|
||||||
|
Reference in New Issue
Block a user