Commit 437769fe authored by David Faure's avatar David Faure
Browse files

Handle items without a known collection as an error, not an assert.

This seems to happen when deleting a collection (happened to me and
to Martin Koller in bug 303888), sometimes.

Reviewed by Kevin Krammer

BUG: 303888
parent dff85cc5
......@@ -216,6 +216,15 @@ void MixedMaildirResource::itemRemoved(const Item &item)
{
/* kDebug() << "item.id=" << item.id() << "col=" << collection.remoteId()
<< "collection.remoteRevision=" << item.parentCollection().remoteRevision();*/
Q_ASSERT( !item.remoteId().isEmpty() );
Q_ASSERT( item.parentCollection().isValid() );
if ( item.parentCollection().remoteId().isEmpty() ) {
const QString message = i18nc( "@info:status", "Item %1 belongs to invalid collection %2. Maybe it was deleted meanwhile?", item.id(), item.parentCollection().id() );
kError() << message;
cancelTask( message );
return;
}
if ( !ensureSaneConfiguration() ) {
const QString message = i18nc( "@info:status", "Unusable configuration." );
kError() << message;
......
Supports Markdown
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