diff --git a/FileManager/BackgroundFileSystem.cs b/FileManager/BackgroundFileSystem.cs index 91e47916..a239581c 100644 --- a/FileManager/BackgroundFileSystem.cs +++ b/FileManager/BackgroundFileSystem.cs @@ -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));