mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Update ParseUtil.cs to avoid null references (#14178)
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Jackett.Common.Utils
|
|||||||
RegexOptions.Compiled);
|
RegexOptions.Compiled);
|
||||||
private static readonly Regex ImdbId = new Regex(@"^(?:tt)?(\d{1,8})$", 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) =>
|
public static string NormalizeMultiSpaces(string s) =>
|
||||||
new Regex(@"\s+").Replace(NormalizeSpace(s), " ");
|
new Regex(@"\s+").Replace(NormalizeSpace(s), " ");
|
||||||
|
Reference in New Issue
Block a user