summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-12-02 21:28:52 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-12-02 21:28:52 (GMT)
commit9b2176758ac1649a7090947795d6c62bc3ac4835 (patch)
tree57a400db6eeabba3bab156d6791d505bdc4487de
parent3ec4a7a3444688047fc77bada9ab3240f1c7ff21 (diff)
PimEventsPlugin: catch PayloadException
BUG: 372824 FIXED-IN: 5.4.0
-rw-r--r--plugins/plasma/pimeventsplugin/eventmodel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/plasma/pimeventsplugin/eventmodel.cpp b/plugins/plasma/pimeventsplugin/eventmodel.cpp
index 6bd089b..474a208 100644
--- a/plugins/plasma/pimeventsplugin/eventmodel.cpp
+++ b/plugins/plasma/pimeventsplugin/eventmodel.cpp
@@ -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?!
}