From 4649633af4ff44eaeff062df1f69601ffbdaa167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vertti=20Ahlst=C3=A9n?= Date: Wed, 11 Dec 2024 16:04:42 +0200 Subject: [PATCH] DeleteSourceFile if updated to oneliner --- .../Frends.AmazonS3.DownloadObject/DownloadObject.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Frends.AmazonS3.DownloadObject/Frends.AmazonS3.DownloadObject/DownloadObject.cs b/Frends.AmazonS3.DownloadObject/Frends.AmazonS3.DownloadObject/DownloadObject.cs index 4433858..648f2a2 100644 --- a/Frends.AmazonS3.DownloadObject/Frends.AmazonS3.DownloadObject/DownloadObject.cs +++ b/Frends.AmazonS3.DownloadObject/Frends.AmazonS3.DownloadObject/DownloadObject.cs @@ -175,10 +175,7 @@ private static async Task DeleteSourceFile(AmazonS3Client client, string b var deleted = await client.DeleteObjectAsync(deleteObjectRequest, cancellationToken); - if (deleted.DeleteMarker == "true") - return true; - else - return false; + return string.IsNullOrEmpty(deleted.DeleteMarker) ? false : bool.Parse(deleted.DeleteMarker); } catch (Exception ex) {