Commit 149f88ea authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

IMAP: handle when RetrieveItemTask fails to find the message

Can happen if the Akonadi database contains invalid items or when the
Item is deleted before the task is dispatched.

BUG: 383951
FIXED-IN: 5.6.2
parent 591ee02f
......@@ -96,7 +96,11 @@ void RetrieveItemTask::onMessagesReceived(const QMap<qint64, KIMAP::Message> &me
{
KIMAP::FetchJob *fetch = qobject_cast<KIMAP::FetchJob *>(sender());
Q_ASSERT(fetch != nullptr);
Q_ASSERT(messages.size() == 1);
if (messages.size() == 0) {
qCDebug(IMAPRESOURCE_LOG) << "Requested message does not exist on the server anymore";
cancelTask(i18n("No message retrieved, failed to read the message."));
return;
}
Akonadi::Item i = item();
......
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