Fuxed possible null reference.
This commit is contained in:
parent
c45e6d526c
commit
bb46021f20
1 changed files with 2 additions and 0 deletions
|
|
@ -22,6 +22,8 @@ namespace FileManager
|
||||||
|
|
||||||
public string FindFile(string regexPattern, RegexOptions options)
|
public string FindFile(string regexPattern, RegexOptions options)
|
||||||
{
|
{
|
||||||
|
if (fsCache is null) return null;
|
||||||
|
|
||||||
lock (fsCache)
|
lock (fsCache)
|
||||||
{
|
{
|
||||||
return fsCache.FirstOrDefault(s => Regex.IsMatch(s, regexPattern, options));
|
return fsCache.FirstOrDefault(s => Regex.IsMatch(s, regexPattern, options));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue