Fix FilePathCache NRE (#680)
This commit is contained in:
parent
668cd7dba8
commit
90eccbf2f6
@ -56,11 +56,11 @@ namespace LibationFileManager
|
|||||||
?.FirstOrDefault()
|
?.FirstOrDefault()
|
||||||
?.Path;
|
?.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();
|
var entries = cache.Where(predicate).ToList();
|
||||||
if (entries is null || !entries.Any())
|
if (entries is null || !entries.Any())
|
||||||
return null;
|
return Enumerable.Empty<CacheEntry>();
|
||||||
|
|
||||||
remove(entries.Where(e => !File.Exists(e.Path)).ToList());
|
remove(entries.Where(e => !File.Exists(e.Path)).ToList());
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user