Commit 9b217675 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

PimEventsPlugin: catch PayloadException

BUG: 372824
FIXED-IN: 5.4.0
parent 3ec4a7a3
......@@ -62,7 +62,12 @@ void EventModel::createMonitor()
});
connect(mMonitor, &Akonadi::Monitor::itemChanged,
this, [this](const Akonadi::Item & item) {
const KCalCore::Incidence::Ptr incidence = item.payload<KCalCore::Incidence::Ptr>();
KCalCore::Incidence::Ptr incidence;
try {
incidence = item.payload<KCalCore::Incidence::Ptr>();
} catch (const Akonadi::PayloadException &e) {
qCWarning(PIMEVENTSPLUGIN_LOG) << "Item" << item.id() << "has no payload:" << e.what();
}
if (!incidence) {
return; // HUH?!
}
......
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