Fuxed possible null reference.

This commit is contained in:
Michael Bucari-Tovo 2021-08-03 06:41:22 -06:00
parent c45e6d526c
commit bb46021f20

View File

@ -22,6 +22,8 @@ namespace FileManager
public string FindFile(string regexPattern, RegexOptions options)
{
if (fsCache is null) return null;
lock (fsCache)
{
return fsCache.FirstOrDefault(s => Regex.IsMatch(s, regexPattern, options));