Skip to content

Commit ba1c642

Browse files
authored
Merge pull request #3105 from SoundersFan/FileCacheNullReference
FileCache throws NullReferenceException
2 parents 5b8f90e + 4a94c7a commit ba1c642

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Microsoft.Toolkit.Uwp.UI/Cache/FileCache.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class FileCache : CacheBase<StorageFile>
3434
protected override Task<StorageFile> InitializeTypeAsync(Stream stream, List<KeyValuePair<string, object>> initializerKeyValues = null)
3535
{
3636
// nothing to do in this instance;
37-
return null;
37+
return Task.FromResult<StorageFile>(null);
3838
}
3939

4040
/// <summary>
@@ -45,7 +45,7 @@ protected override Task<StorageFile> InitializeTypeAsync(Stream stream, List<Key
4545
/// <returns>awaitable task</returns>
4646
protected override Task<StorageFile> InitializeTypeAsync(StorageFile baseFile, List<KeyValuePair<string, object>> initializerKeyValues = null)
4747
{
48-
return Task.Run(() => baseFile);
48+
return Task.FromResult(baseFile);
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)