Fix FilePathCache NRE (#680)

This commit is contained in:
Mbucari 2023-07-17 08:55:55 -06:00
parent 668cd7dba8
commit 90eccbf2f6

View File

@ -56,11 +56,11 @@ namespace LibationFileManager
?.FirstOrDefault()
?.Path;
private static List<CacheEntry> getEntries(Func<CacheEntry, bool> predicate)
private static IEnumerable<CacheEntry> getEntries(Func<CacheEntry, bool> predicate)
{
var entries = cache.Where(predicate).ToList();
if (entries is null || !entries.Any())
return null;
return Enumerable.Empty<CacheEntry>();
remove(entries.Where(e => !File.Exists(e.Path)).ToList());