From 0a223ee2a04716a02e683fe4621c049378ca5767 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Mon, 6 Nov 2017 14:40:23 -0500 Subject: [PATCH] contrib/rss_downloader: fix nullable usage for title and link Signed-off-by: Alexandre Terrasa --- contrib/rss_downloader/src/rss_downloader.nit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contrib/rss_downloader/src/rss_downloader.nit b/contrib/rss_downloader/src/rss_downloader.nit index a738c05..022543e 100644 --- a/contrib/rss_downloader/src/rss_downloader.nit +++ b/contrib/rss_downloader/src/rss_downloader.nit @@ -274,6 +274,16 @@ redef class Text var title = item[tool_config.as(not null).tag_title].first.as(XMLStartTag).data var link = item[tool_config.as(not null).tag_link].first.as(XMLStartTag).data + if title == null then + print_error "RSS Parse Error: title is null" + return elements + end + + if link == null then + print_error "RSS Parse Error: link is null" + return elements + end + elements.add new Element(title, link) end -- 1.7.9.5