File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ internal class DeepLContext : IContext
1919 private readonly ILogger _logger ;
2020 private readonly Func < string , FileInfo > _fileInfoFactory ;
2121 private readonly Func < string , DirectoryInfo > _directoryInfoFactory ;
22- private readonly Regex _excludesRegex ;
22+ private readonly Regex ? _excludesRegex ;
2323
2424 public DeepLContext (
2525 IActionInputs actionInputs ,
@@ -35,7 +35,7 @@ public DeepLContext(
3535 _fileInfoFactory = fileInfoFactory ;
3636 _directoryInfoFactory = directoryInfoFactory ;
3737
38- _excludesRegex = regexFactory ( actionInputs . ExcludesRegex ) ;
38+ _excludesRegex = string . IsNullOrWhiteSpace ( actionInputs . ExcludesRegex ) ? null : regexFactory ( actionInputs . ExcludesRegex ) ;
3939 }
4040
4141 public async Task TraverseAndTranslate ( )
@@ -70,7 +70,7 @@ bool IsDefaultResxFileName(FileInfo fi)
7070 }
7171 bool IsNotExcluded ( FileInfo defaultResXFile )
7272 {
73- var ret = ! _excludesRegex . IsMatch ( defaultResXFile . Name ) ;
73+ var ret = ! ( _excludesRegex ? . IsMatch ( defaultResXFile . Name ) ?? false ) ;
7474 if ( ret ) _logger . Notice ( defaultResXFile , "Default file excluded by regex" ) ;
7575 return ret ;
7676 }
You can’t perform that action at this time.
0 commit comments