mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 14:55:20 -07:00
Fixed: Guard agains null reference exception with newznab capabilities.
This commit is contained in:
parent
668ef336fb
commit
605b8f9645
1 changed files with 13 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue