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); }