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
@@ -43,14 +43,12 @@ namespace NzbDrone.Core.Indexers.Newznab
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 NewznabSettings GetDefaultBaseUrl(NewznabSettings settings)
@@ -62,7 +60,7 @@ namespace NzbDrone.Core.Indexers.Newznab
{
var caps = new IndexerCapabilities();
if (Definition == null || Settings == null || Settings.Categories == null)
if (Definition == null || Settings?.Categories == null)
{
return caps;
}