소스 검색

Fix edgecase with nonexistent tweet not withheld

Zed 7 년 전
부모
커밋
369dc994b8
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/parser.nim

+ 3 - 0
src/parser.nim

@@ -88,6 +88,9 @@ proc parseQuote*(quote: XmlNode): Quote =
   result.getQuoteMedia(quote)
 
 proc parseTweet*(node: XmlNode): Tweet =
+  if node == nil:
+    return Tweet()
+
   if "withheld" in node.attr("class"):
     return Tweet(tombstone: getTombstone(node.selectText(".Tombstone-label")))