Skip to content

Commit

Permalink
Merge pull request CommunityToolkit#3105 from SoundersFan/FileCacheNu…
Browse files Browse the repository at this point in the history
…llReference

FileCache throws NullReferenceException
  • Loading branch information
hermitdave committed Jan 29, 2020
2 parents 5b8f90e + 4a94c7a commit ba1c642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Microsoft.Toolkit.Uwp.UI/Cache/FileCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class FileCache : CacheBase<StorageFile>
protected override Task<StorageFile> InitializeTypeAsync(Stream stream, List<KeyValuePair<string, object>> initializerKeyValues = null)
{
// nothing to do in this instance;
return null;
return Task.FromResult<StorageFile>(null);
}

/// <summary>
Expand All @@ -45,7 +45,7 @@ protected override Task<StorageFile> InitializeTypeAsync(Stream stream, List<Key
/// <returns>awaitable task</returns>
protected override Task<StorageFile> InitializeTypeAsync(StorageFile baseFile, List<KeyValuePair<string, object>> initializerKeyValues = null)
{
return Task.Run(() => baseFile);
return Task.FromResult(baseFile);
}
}
}

0 comments on commit ba1c642

Please sign in to comment.