@@ -59,6 +59,9 @@ public override async IAsyncEnumerable<BlobMetadata> GetBlobMetadataListAsync(st
5959 if ( cancellationToken . IsCancellationRequested )
6060 yield break ;
6161
62+ if ( objectsResponse ? . S3Objects == null )
63+ yield break ;
64+
6265 foreach ( var entry in objectsResponse . S3Objects )
6366 {
6467 if ( cancellationToken . IsCancellationRequested )
@@ -78,15 +81,15 @@ public override async IAsyncEnumerable<BlobMetadata> GetBlobMetadataListAsync(st
7881 FullName = $ "{ StorageOptions . Bucket } /{ entry . Key } ",
7982 Container = StorageOptions . Bucket ,
8083 Uri = new Uri ( $ "https://s3.amazonaws.com/{ StorageOptions . Bucket } /{ entry . Key } ") ,
81- LastModified = objectMetaResponse . LastModified ,
82- CreatedOn = objectMetaResponse . LastModified ,
84+ LastModified = objectMetaResponse . LastModified . HasValue ? new DateTimeOffset ( objectMetaResponse . LastModified . Value ) : DateTimeOffset . MinValue ,
85+ CreatedOn = objectMetaResponse . LastModified . HasValue ? new DateTimeOffset ( objectMetaResponse . LastModified . Value ) : DateTimeOffset . MinValue ,
8386 MimeType = objectMetaResponse . Headers . ContentType ,
8487 Length = ( ulong ) objectMetaResponse . Headers . ContentLength
8588 } ;
8689 }
8790
8891 // If response is truncated, set the marker to get the next set of keys.
89- if ( objectsResponse . IsTruncated )
92+ if ( objectsResponse . IsTruncated == true )
9093 objectsRequest . Marker = objectsResponse . NextMarker ;
9194 else
9295 objectsRequest = null ;
@@ -208,8 +211,8 @@ protected override async Task<Result<LocalFile>> DownloadInternalAsync(LocalFile
208211 Name = options . FileName ,
209212 Container = StorageOptions . Bucket ,
210213 Uri = new Uri ( $ "https://s3.amazonaws.com/{ StorageOptions . Bucket } /{ options . FullPath } ") ,
211- LastModified = response . LastModified ,
212- CreatedOn = response . LastModified ,
214+ LastModified = response . LastModified . HasValue ? new DateTimeOffset ( response . LastModified . Value ) : DateTimeOffset . MinValue ,
215+ CreatedOn = response . LastModified . HasValue ? new DateTimeOffset ( response . LastModified . Value ) : DateTimeOffset . MinValue ,
213216 MimeType = response . Headers . ContentType ,
214217 Length = ( ulong ) response . Headers . ContentLength
215218 } ;
@@ -298,8 +301,8 @@ protected override async Task<Result<BlobMetadata>> GetBlobMetadataInternalAsync
298301 Name = options . FileName ,
299302 Container = StorageOptions . Bucket ,
300303 Uri = new Uri ( $ "https://s3.amazonaws.com/{ StorageOptions . Bucket } /{ options . FullPath } ") ,
301- LastModified = objectMetaResponse . LastModified ,
302- CreatedOn = objectMetaResponse . LastModified ,
304+ LastModified = objectMetaResponse . LastModified . HasValue ? new DateTimeOffset ( objectMetaResponse . LastModified . Value ) : DateTimeOffset . MinValue ,
305+ CreatedOn = objectMetaResponse . LastModified . HasValue ? new DateTimeOffset ( objectMetaResponse . LastModified . Value ) : DateTimeOffset . MinValue ,
303306 MimeType = objectMetaResponse . Headers . ContentType ,
304307 Length = ( ulong ) objectMetaResponse . Headers . ContentLength
305308 } ;
0 commit comments