Commit b526912b authored by Laurent Montel's avatar Laurent Montel 😁

add more check

parent 4c440ae1
......@@ -45,6 +45,9 @@ bool SearchRuleDate::isEmpty() const
bool SearchRuleDate::matches(const Akonadi::Item &item) const
{
if (!item.hasPayload<KMime::Message::Ptr>()) {
return false;
}
const KMime::Message::Ptr msg = item.payload<KMime::Message::Ptr>();
const QDate msgDate = msg->date()->dateTime().date();
......
......@@ -48,6 +48,10 @@ bool SearchRuleNumerical::isEmpty() const
bool SearchRuleNumerical::matches(const Akonadi::Item &item) const
{
if (!item.hasPayload<KMime::Message::Ptr>()) {
return false;
}
const KMime::Message::Ptr msg = item.payload<KMime::Message::Ptr>();
QString msgContents;
......
......@@ -101,6 +101,10 @@ bool SearchRuleString::matches(const Akonadi::Item &item) const
if (isEmpty()) {
return false;
}
if (!item.hasPayload<KMime::Message::Ptr>()) {
return false;
}
const KMime::Message::Ptr msg = item.payload<KMime::Message::Ptr>();
Q_ASSERT(msg.data());
......
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