PropertyExtractor: Add null check for event.submitter If the change was open, it would cause event.submitter to be null. Fix this by adding a null check. Gerrit's core does the same thing. Bug: Issue 8051 Change-Id: I0690e184ba50ea1e60176e8be5af34c43a80393e
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java index b26db77..f9c589d 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java +++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java
@@ -109,7 +109,9 @@ private Map<String, Set<String>> extractFrom(RefUpdatedEvent event, Set<Property> common) { common.add(propertyFactory.create("event-type", event.type)); - common.addAll(propertyAttributeExtractor.extractFrom(event.submitter.get(), "submitter")); + if (event.submitter != null) { + common.addAll(propertyAttributeExtractor.extractFrom(event.submitter.get(), "submitter")); + } common.addAll(propertyAttributeExtractor.extractFrom(event.refUpdate.get())); RefUpdateAttribute refUpdated = event.refUpdate.get(); if (ObjectId.zeroId().name().equals(refUpdated.newRev)) {