From a63a83c751c88ace9abde8ae7ec82372f0123c33 Mon Sep 17 00:00:00 2001 From: Taylor Gray Date: Fri, 8 Sep 2023 13:55:43 -0500 Subject: [PATCH] Fix NPE in s3 scan partition supplier Signed-off-by: Taylor Gray --- .../plugins/source/S3ScanPartitionCreationSupplier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-prepper-plugins/s3-source/src/main/java/org/opensearch/dataprepper/plugins/source/S3ScanPartitionCreationSupplier.java b/data-prepper-plugins/s3-source/src/main/java/org/opensearch/dataprepper/plugins/source/S3ScanPartitionCreationSupplier.java index 5ec4848354..f82b75d9b7 100644 --- a/data-prepper-plugins/s3-source/src/main/java/org/opensearch/dataprepper/plugins/source/S3ScanPartitionCreationSupplier.java +++ b/data-prepper-plugins/s3-source/src/main/java/org/opensearch/dataprepper/plugins/source/S3ScanPartitionCreationSupplier.java @@ -101,7 +101,7 @@ private List listFilteredS3ObjectsForBucket(final List globalStateMap) { - Instant mostRecentLastModifiedTimestamp = globalStateMap.containsKey(bucket) ? Instant.parse((String) globalStateMap.get(bucket)) : null; + Instant mostRecentLastModifiedTimestamp = globalStateMap.containsKey(bucket) && Objects.nonNull(globalStateMap.get(bucket)) ? Instant.parse((String) globalStateMap.get(bucket)) : null; final List allPartitionIdentifiers = new ArrayList<>(); ListObjectsV2Response listObjectsV2Response = null; do {