Commit 09252bec authored by Laurent Montel's avatar Laurent Montel 😁

Fix crash when currentFolder is null (when we show intro for example)

parent 4cd0d1b3
......@@ -4324,11 +4324,13 @@ void KMMainWidget::slotMessageSelected(const Akonadi::Item &item)
mShowBusySplashTimer->start( GlobalSettings::self()->folderLoadingTimeout() ); //TODO: check if we need a different timeout setting for this
Akonadi::ItemFetchJob *itemFetchJob = MessageViewer::Viewer::createFetchJob( item );
const QString resource = mCurrentFolder->collection().resource();
itemFetchJob->setProperty( "_resource", QVariant::fromValue(resource) );
connect( itemFetchJob, SIGNAL(itemsReceived(Akonadi::Item::List)),
SLOT(itemsReceived(Akonadi::Item::List)) );
connect( itemFetchJob, SIGNAL(result(KJob*)), SLOT(itemsFetchDone(KJob*)) );
if (mCurrentFolder) {
const QString resource = mCurrentFolder->collection().resource();
itemFetchJob->setProperty( "_resource", QVariant::fromValue(resource) );
connect( itemFetchJob, SIGNAL(itemsReceived(Akonadi::Item::List)),
SLOT(itemsReceived(Akonadi::Item::List)) );
connect( itemFetchJob, SIGNAL(result(KJob*)), SLOT(itemsFetchDone(KJob*)) );
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment