Skip to content

Commit

Permalink
Update ParseUtil.cs to avoid null references (#14178)
Browse files Browse the repository at this point in the history
  • Loading branch information
garfield69 committed Mar 21, 2023
1 parent 8a5c55a commit 36abce2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Jackett.Common/Utils/ParseUtil.cs
Expand Up @@ -13,7 +13,7 @@ public static class ParseUtil
RegexOptions.Compiled);
private static readonly Regex ImdbId = new Regex(@"^(?:tt)?(\d{1,8})$", RegexOptions.Compiled);

public static string NormalizeSpace(string s) => s.Trim();
public static string NormalizeSpace(string s) => s?.Trim() ?? string.Empty;

public static string NormalizeMultiSpaces(string s) =>
new Regex(@"\s+").Replace(NormalizeSpace(s), " ");
Expand Down

0 comments on commit 36abce2

Please sign in to comment.