From bb46021f20fc3a06be0f140eedfac5a7d01406b1 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Tue, 3 Aug 2021 06:41:22 -0600 Subject: [PATCH] Fuxed possible null reference. --- FileManager/BackgroundFileSystem.cs | 2 ++ 1 file changed, 2 insertions(+) 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));