Skip to content

Commit 3662c25

Browse files
authored
Adds a null check when reading an S3EventNotification for records. Some recent change resulted in ObjectMapper::treeToValue return null for an empty string. (#5933)
Signed-off-by: David Venable <dlv@amazon.com>
1 parent b87890a commit 3662c25

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

data-prepper-plugins/s3-source/src/main/java/org/opensearch/dataprepper/plugins/source/s3/parser/S3EventNotificationParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public ParsedMessage parseMessage(final Message message, final ObjectMapper obje
2020
final JsonNode eventNode = getS3EventNode(parsedNode, objectMapper);
2121

2222
final S3EventNotification s3EventNotification = objectMapper.treeToValue(eventNode, S3EventNotification.class);
23-
if (s3EventNotification.getRecords() != null) {
23+
if (s3EventNotification != null && s3EventNotification.getRecords() != null) {
2424
return new ParsedMessage(message, s3EventNotification.getRecords());
2525
} else {
2626
LOG.debug("SQS message with ID:{} does not have any S3 event notification records.", message.messageId());

0 commit comments

Comments
 (0)