mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Guard agains null reference exception with newznab capabilities.
This commit is contained in:
@@ -84,7 +84,19 @@ namespace NzbDrone.Core.Indexers.Newznab
|
|||||||
{
|
{
|
||||||
var capabilities = new NewznabCapabilities();
|
var capabilities = new NewznabCapabilities();
|
||||||
|
|
||||||
var xmlRoot = XDocument.Parse(response.Content).Element("caps");
|
var xDoc = XDocument.Parse(response.Content);
|
||||||
|
|
||||||
|
if (xDoc == null)
|
||||||
|
{
|
||||||
|
throw new XmlException("Invalid XML");
|
||||||
|
}
|
||||||
|
|
||||||
|
var xmlRoot = xDoc.Element("caps");
|
||||||
|
|
||||||
|
if (xmlRoot == null)
|
||||||
|
{
|
||||||
|
throw new XmlException("Unexpected XML");
|
||||||
|
}
|
||||||
|
|
||||||
var xmlLimits = xmlRoot.Element("limits");
|
var xmlLimits = xmlRoot.Element("limits");
|
||||||
if (xmlLimits != null)
|
if (xmlLimits != null)
|
||||||
|
Reference in New Issue
Block a user