Fixes possible crash in the RSS Downloader dialog (when having RSS folders)

This commit is contained in:
Christophe Dumez 2010-12-18 18:42:31 +00:00
parent d124c24e89
commit c3322cdc91
2 changed files with 14 additions and 2 deletions

View file

@ -268,7 +268,9 @@ QHash<QString, RssFeed*> RssFolder::getAllFeedsAsHash() const {
QHash<QString, RssFeed*> ret;
foreach(RssFile *item, this->values()) {
if(item->getType() == RssFile::FEED) {
RssFeed* feed = static_cast<RssFeed*>(item);
RssFeed* feed = dynamic_cast<RssFeed*>(item);
Q_ASSERT(feed);
qDebug() << Q_FUNC_INFO << feed->getUrl();
ret[feed->getUrl()] = feed;
} else {
ret.unite(static_cast<RssFolder*>(item)->getAllFeedsAsHash());