Avoid NullPointer in transform output strategy
@@ -60,9 +60,14 @@ public class TransformOutputSchemaGenerator extends OutputSchemaGenerator<Transf
staticProperties);
if (mappingPropertyOpt.isPresent()) {
- Optional<EventProperty> eventPropertyOpt = findEventProperty(mappingPropertyOpt.get().getSelectedProperty()
- , inSchema
- .getEventProperties());
+ MappingPropertyUnary mappingProperty = mappingPropertyOpt.get();
+ String selectedProperty = mappingProperty.getSelectedProperty();
+
+ if (selectedProperty != null) {
+ Optional<EventProperty> eventPropertyOpt = findEventProperty(
+ mappingPropertyOpt.get().getSelectedProperty(),
+ inSchema.getEventProperties()
+ );
if (eventPropertyOpt.isPresent()) {
EventProperty eventProperty = eventPropertyOpt.get();
@@ -70,6 +75,7 @@ public class TransformOutputSchemaGenerator extends OutputSchemaGenerator<Transf
staticProperties));
}
}
+ }
});
List<EventProperty> newProperties = inSchema.getEventProperties()
