Browse Source

Fix possible null pointer dereference

adaptive-webui-19844
Vladimir Golovnev (Glassez) 8 years ago
parent
commit
abfcfb5af0
  1. 4
      src/gui/rss/rsswidget.cpp

4
src/gui/rss/rsswidget.cpp

@ -224,7 +224,7 @@ void RSSWidget::askNewFolder() @@ -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<RSS::Folder *>(m_feedListWidget->getRSSItem(destItem)));
@ -234,7 +234,7 @@ void RSSWidget::askNewFolder() @@ -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)));

Loading…
Cancel
Save