Fixed: Prevent NullRef in NewznabRequestGenerator for missing definition

pull/1893/head
Bogdan 8 months ago
parent b1f7d30021
commit 7e32b54547

@ -19,6 +19,11 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
[SetUp]
public void SetUp()
{
Subject.Definition = new IndexerDefinition
{
Name = "Newznab"
};
Subject.Settings = new NewznabSettings()
{
BaseUrl = "http://127.0.0.1:1234/",

@ -31,6 +31,7 @@ namespace NzbDrone.Core.Indexers.Newznab
{
return new NewznabRequestGenerator(_capabilitiesProvider)
{
Definition = Definition,
PageSize = PageSize,
Settings = Settings
};

@ -13,10 +13,11 @@ namespace NzbDrone.Core.Indexers.Newznab
public class NewznabRequestGenerator : IIndexerRequestGenerator
{
private readonly INewznabCapabilitiesProvider _capabilitiesProvider;
public ProviderDefinition Definition { get; set; }
public int MaxPages { get; set; }
public int PageSize { get; set; }
public NewznabSettings Settings { get; set; }
public ProviderDefinition Definition { get; set; }
public NewznabRequestGenerator(INewznabCapabilitiesProvider capabilitiesProvider)
{

@ -31,6 +31,7 @@ namespace NzbDrone.Core.Indexers.Torznab
{
return new NewznabRequestGenerator(_capabilitiesProvider)
{
Definition = Definition,
PageSize = PageSize,
Settings = Settings
};

Loading…
Cancel
Save