diff --git a/src/contactmethod.cpp b/src/contactmethod.cpp index 24bcff752102262177b6019773a63c60e4ef0920..94c2d63eaca9cf34bf0f182d46b7dc9d171019f3 100644 --- a/src/contactmethod.cpp +++ b/src/contactmethod.cpp @@ -457,7 +457,7 @@ QVariant ContactMethod::roleData(int role) const { QVariant cat; - auto lastCall = d_ptr->m_lCalls.last(); + auto lastCall = d_ptr->m_lCalls.isEmpty() ? nullptr : d_ptr->m_lCalls.last(); switch (role) { case static_cast<int>(Call::Role::Name):