Fixed: (Apps) Ensure populated capabilities for Torznab/Newznab definitions

This commit is contained in:
Bogdan
2023-07-29 12:08:48 +03:00
parent cab50b35aa
commit 8b1dd78300
4 changed files with 13 additions and 16 deletions
@@ -45,14 +45,12 @@ namespace NzbDrone.Core.Indexers.Torznab
public string[] GetBaseUrlFromSettings()
{
var baseUrl = "";
if (Definition == null || Settings == null || Settings.Categories == null)
if (Definition == null || Settings?.Categories == null)
{
return new string[] { baseUrl };
return new[] { "" };
}
return new string[] { Settings.BaseUrl };
return new[] { Settings.BaseUrl };
}
protected override TorznabSettings GetDefaultBaseUrl(TorznabSettings settings)
@@ -64,7 +62,7 @@ namespace NzbDrone.Core.Indexers.Torznab
{
var caps = new IndexerCapabilities();
if (Definition == null || Settings == null || Settings.Categories == null)
if (Definition == null || Settings?.Categories == null)
{
return caps;
}