From 495800d6e99b5550cd3e9bf74fc3fd0d9a21684e Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Thu, 28 Aug 2014 18:52:48 +0300 Subject: [PATCH] Possible fix for crash in RSS code. Closes #1901. --- src/rss/rss_imp.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rss/rss_imp.cpp b/src/rss/rss_imp.cpp index 77ee62c6a..c8e39c4df 100644 --- a/src/rss/rss_imp.cpp +++ b/src/rss/rss_imp.cpp @@ -334,8 +334,11 @@ void RSSImp::downloadSelectedTorrents() { QList selected_items = listArticles->selectedItems(); foreach (const QListWidgetItem* item, selected_items) { - RssArticlePtr article = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString()) - ->getItem(item->data(Article::IdRole).toString()); + if (!item) continue; + RssFeedPtr feed = m_feedList->getRSSItemFromUrl(item->data(Article::FeedUrlRole).toString()); + if (!feed) continue; + RssArticlePtr article = feed->getItem(item->data(Article::IdRole).toString()); + if (!article) continue; QString torrentLink = article->torrentUrl(); // Check if it is a magnet link