Skip to content

Commit 20611f8

Browse files
Fix ArgumentNullException
Fix `ArgumentNullException` caused by `Buckets` being `null` by default in v4 of the AWS SDK.
1 parent 11a6635 commit 20611f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/net8.0/aspnetcore/Controllers/AwsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public async Task<ActionResult<string[]>> ListBuckets()
1717
{
1818
var response = await client.ListBucketsAsync();
1919

20-
var buckets = response.Buckets.Select(o => o.BucketName).ToArray();
20+
var buckets = response.Buckets?.Select(o => o.BucketName).ToArray() ?? [];
2121

2222
logger.LogInformation("Found {Count} buckets.", buckets.Length);
2323

0 commit comments

Comments
 (0)