Update ImageFileCache.cs

This commit is contained in:
ClemensFischer 2024-02-05 16:59:00 +01:00
parent 7e5a61b4e0
commit b77a29b4e1

View file

@ -93,13 +93,13 @@ namespace MapControl.Caching
{
var buffer = await memoryCache.GetAsync(key, token).ConfigureAwait(false);
if (buffer == null && !token.IsCancellationRequested)
if (buffer == null)
{
var path = GetPath(key);
try
{
if (path != null && File.Exists(path))
if (path != null && File.Exists(path) && !token.IsCancellationRequested)
{
buffer = await ReadAllBytesAsync(path).ConfigureAwait(false);