diff options
Diffstat (limited to 'Emby.Naming/Video/CleanStringParser.cs')
| -rw-r--r-- | Emby.Naming/Video/CleanStringParser.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Emby.Naming/Video/CleanStringParser.cs b/Emby.Naming/Video/CleanStringParser.cs index 09a0cd189..bd7553a91 100644 --- a/Emby.Naming/Video/CleanStringParser.cs +++ b/Emby.Naming/Video/CleanStringParser.cs @@ -33,6 +33,12 @@ namespace Emby.Naming.Video private static bool TryClean(string name, Regex expression, out ReadOnlySpan<char> newName) { + if (string.IsNullOrEmpty(name)) + { + newName = ReadOnlySpan<char>.Empty; + return false; + } + var match = expression.Match(name); int index = match.Index; if (match.Success && index != 0) @@ -41,7 +47,7 @@ namespace Emby.Naming.Video return true; } - newName = string.Empty; + newName = ReadOnlySpan<char>.Empty; return false; } } |
