mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Fixed: Guard agains null reference exception with newznab capabilities.
This commit is contained in:
parent
668ef336fb
commit
605b8f9645
@ -84,7 +84,19 @@ private NewznabCapabilities ParseCapabilities(HttpResponse response)
|
||||
{
|
||||
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");
|
||||
if (xmlLimits != null)
|
||||
|
Loading…
Reference in New Issue
Block a user