indexers: don't die when download links are null

Co-authored-by: kwazou <kwazou@gmail.com>
This commit is contained in:
Bogdan
2023-11-06 19:27:32 +02:00
parent a4310e6d27
commit e23f44aa56

View File

@@ -85,11 +85,11 @@ namespace Jackett.Common.Models
r.Files == null ? null : new XElement("files", r.Files),
r.Grabs == null ? null : new XElement("grabs", r.Grabs),
new XElement("description", RemoveInvalidXMLChars(r.Description)),
new XElement("link", r.Link?.AbsoluteUri ?? r.MagnetUri.AbsoluteUri),
new XElement("link", r.Link?.AbsoluteUri ?? r.MagnetUri?.AbsoluteUri ?? string.Empty),
r.Category == null ? null : from c in r.Category select new XElement("category", c),
new XElement(
"enclosure",
new XAttribute("url", r.Link?.AbsoluteUri ?? r.MagnetUri.AbsoluteUri),
new XAttribute("url", r.Link?.AbsoluteUri ?? r.MagnetUri?.AbsoluteUri ?? string.Empty),
r.Size == null ? null : new XAttribute("length", r.Size),
new XAttribute("type", "application/x-bittorrent")
),