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:
Shawn Pearce
2013-03-01 09:31:44 -08:00
parent bf149b364f
commit d50e456584

View File

@@ -109,6 +109,9 @@ public class ReviewerJson {
PatchSet ps = cd.currentPatchSet(db);
if (ps != null) {
for (SubmitRecord rec : ctl.canSubmit(db.get(), ps, cd, true, false)) {
if (rec.labels == null) {
continue;
}
for (SubmitRecord.Label label : rec.labels) {
String name = label.label;
if (!out.approvals.containsKey(name)