From abfcfb5af00987252ea9151fbe3be8ed44d1c37b Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 24 Apr 2017 21:05:27 +0300 Subject: [PATCH] Fix possible null pointer dereference --- src/gui/rss/rsswidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/rss/rsswidget.cpp b/src/gui/rss/rsswidget.cpp index 6ffdb33fd..05fab9438 100644 --- a/src/gui/rss/rsswidget.cpp +++ b/src/gui/rss/rsswidget.cpp @@ -224,7 +224,7 @@ void RSSWidget::askNewFolder() destItem = destItem->parent(); } // Consider the case where the user clicked on Unread item - RSS::Folder *rssDestFolder = ((destItem == m_feedListWidget->stickyUnreadItem()) + RSS::Folder *rssDestFolder = ((!destItem || (destItem == m_feedListWidget->stickyUnreadItem())) ? RSS::Session::instance()->rootFolder() : qobject_cast(m_feedListWidget->getRSSItem(destItem))); @@ -234,7 +234,7 @@ void RSSWidget::askNewFolder() QMessageBox::warning(this, "qBittorrent", error, QMessageBox::Ok); // Expand destination folder to display new feed - if (destItem != m_feedListWidget->stickyUnreadItem()) + if (destItem && (destItem != m_feedListWidget->stickyUnreadItem())) destItem->setExpanded(true); // As new RSS items are added synchronously, we can do the following here. m_feedListWidget->setCurrentItem(m_feedListWidget->mapRSSItem(RSS::Session::instance()->itemByPath(newFolderPath)));