-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: 1.5.0
-
Component/s: Sink
Returning null from a custom WriteModelStrategy (as documented in https://docs.mongodb.com/kafka-connector/current/kafka-sink-postprocessors/#:~:text=Return%20null%20to%20indicate%20no%20op) throws a NullPointerException when trying to wrap the returned value in a java.util.Optional.
The fix seems trivial: Use Optional.ofNullable(value) instead of Optional.of(value)