From 376202e2af7791de75a7d36b504db8ff90f746ae Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 11 Jul 2023 04:53:43 +0300 Subject: [PATCH] Fixed: (BTN) Prevent NullRef when Result.Torrents is null --- .../Indexers/Definitions/BroadcastheNet/BroadcastheNet.cs | 6 +++--- .../Definitions/BroadcastheNet/BroadcastheNetParser.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNet.cs b/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNet.cs index 22c3cbb28..074e3ec43 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNet.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNet.cs @@ -56,9 +56,9 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet LimitsDefault = 100, LimitsMax = 1000, TvSearchParams = new List - { - TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.TvdbId, TvSearchParam.RId - } + { + TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.TvdbId, TvSearchParam.RId + } }; caps.Categories.AddCategoryMapping("SD", NewznabStandardCategory.TVSD, "SD"); diff --git a/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs b/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs index d06bef210..4650671c5 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/BroadcastheNet/BroadcastheNetParser.cs @@ -12,7 +12,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet { public class BroadcastheNetParser : IParseIndexerResponse { - private static readonly Regex RegexProtocol = new Regex("^https?:", RegexOptions.Compiled); + private static readonly Regex RegexProtocol = new ("^https?:", RegexOptions.Compiled); public Action, DateTime?> CookiesUpdater { get; set; } @@ -67,7 +67,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet throw new IndexerException(indexerResponse, "Indexer API call returned an error [{0}]", jsonResponse.Error); } - if (jsonResponse.Result.Results == 0) + if (jsonResponse.Result.Results == 0 || jsonResponse.Result?.Torrents?.Values == null) { return results; }