From 209e88527a3861a1bb860fada43eefaa963627ea Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 21 Aug 2025 22:47:35 +0200 Subject: [PATCH] Fix NRE when incrementally syncing with an empty remote s3 bucket --- .../docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tooling/docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs b/src/tooling/docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs index b8ea406ea..6a72d08d7 100644 --- a/src/tooling/docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs +++ b/src/tooling/docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs @@ -109,9 +109,11 @@ private async Task> ListObjects(Cancel ctx = defaul do { response = await s3Client.ListObjectsV2Async(listBucketRequest, ctx); + if (response is null or { S3Objects: null }) + break; objects.AddRange(response.S3Objects); - listBucketRequest.ContinuationToken = response?.NextContinuationToken; - } while (response?.IsTruncated == true); + listBucketRequest.ContinuationToken = response.NextContinuationToken; + } while (response.IsTruncated == true); return objects.ToDictionary(o => o.Key); }