Improved Task usage

This commit is contained in:
ClemensFischer 2024-08-31 12:47:02 +02:00
parent 4e753ae718
commit 71c435c323
2 changed files with 5 additions and 4 deletions

View file

@ -162,17 +162,17 @@ namespace MapControl
}
}
private static Task<byte[]> ReadCacheAsync(string cacheKey)
private static async Task<byte[]> ReadCacheAsync(string cacheKey)
{
try
{
return Cache.GetAsync(cacheKey);
return await Cache.GetAsync(cacheKey);
}
catch (Exception ex)
{
Debug.WriteLine($"TileImageLoader.Cache.GetAsync: {cacheKey}: {ex.Message}");
return Task.FromResult<byte[]>(null);
return null;
}
}