Fix nil card url crash

This commit is contained in:
Zed 2019-10-19 21:46:16 +02:00
parent d5061bde05
commit 3218cc4069

View file

@ -254,7 +254,7 @@ proc parseCard*(card: var Card; node: XmlNode) =
card.dest = node.selectText("span.SummaryCard-destination") card.dest = node.selectText("span.SummaryCard-destination")
if card.url.len == 0: if card.url.len == 0:
card.url = node.select("a").attr("href") card.url = node.selectAttr("a", "href")
let image = node.select(".tcu-imageWrapper img") let image = node.select(".tcu-imageWrapper img")
if image != nil: if image != nil: