Skip to content

Commit 492b5c0

Browse files
authored
Fix NRE when incrementally syncing with an empty remote s3 bucket (#1764)
1 parent f12fa53 commit 492b5c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tooling/docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ private async Task<Dictionary<string, S3Object>> ListObjects(Cancel ctx = defaul
109109
do
110110
{
111111
response = await s3Client.ListObjectsV2Async(listBucketRequest, ctx);
112+
if (response is null or { S3Objects: null })
113+
break;
112114
objects.AddRange(response.S3Objects);
113-
listBucketRequest.ContinuationToken = response?.NextContinuationToken;
114-
} while (response?.IsTruncated == true);
115+
listBucketRequest.ContinuationToken = response.NextContinuationToken;
116+
} while (response.IsTruncated == true);
115117

116118
return objects.ToDictionary(o => o.Key);
117119
}

0 commit comments

Comments
 (0)