Genbox / SimpleS3

A .NET Core implementation of Amazon's S3 API with focus on simplicity, security and performance
MIT License
50 stars 8 forks source link

Bug: DeleteAllObjectsAsync on an empty bucket throws #46

Closed LordMike closed 3 years ago

LordMike commented 3 years ago

The following code makes no attempt at verifying that the count of objects is >0, leading to issues witht the DeleteObjectsAsync call. The previous code (for all versions), has this check: if (response.Versions.Count + response.DeleteMarkers.Count == 0)

https://github.com/Genbox/SimpleS3/blob/0a3b4d67b01bcf62f02ae40b395ccca79294e892/src/SimpleS3.Core/Extensions/ObjectClientExtensions.cs#L101-L114