Skip to content

Commit c24006b

Browse files
Better maxAge check
1 parent 953cca6 commit c24006b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ImageSharp.Web.Providers.Azure/Resolvers/AzureBlobStorageImageResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public async Task<ImageMetadata> GetMetaDataAsync()
3737
if (CacheControlHeaderValue.TryParse(properties.CacheControl, out CacheControlHeaderValue cacheControl))
3838
{
3939
// Weirdly passing null to TryParse returns true.
40-
if (cacheControl != null)
40+
if (cacheControl?.MaxAge.HasValue == true)
4141
{
42-
maxAge = cacheControl.MaxAge.GetValueOrDefault();
42+
maxAge = cacheControl.MaxAge.Value;
4343
}
4444
}
4545

0 commit comments

Comments
 (0)