Merge "Expect API field to be null"
diff --git a/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java b/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java
index 661f3bb..63416a4 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/automerger/DownstreamCreator.java
@@ -219,7 +219,7 @@
ChangeInfo downstreamChange =
gApi.changes().id(changeNumber).get(EnumSet.of(ListChangesOption.CURRENT_REVISION));
for (Map.Entry<String, LabelInfo> labelEntry : labels.entrySet()) {
- if (labelEntry.getValue().all.size() > 0) {
+ if (labelEntry.getValue().all != null && labelEntry.getValue().all.size() > 0) {
OptionalInt maxVote =
labelEntry.getValue().all.stream()
.filter(o -> o.value != null)