[pim/kdepim-runtime] agents/newmailnotifier: Check pointer

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 34965645e0c45e6addc6ff8898007e85d8cb081d by Laurent Montel.
Committed on 16/08/2026 at 11:30.
Pushed by mlaurent into branch 'master'.

Check pointer

M  +2    -2    agents/newmailnotifier/specialnotifierjob.cpp

https://invent.kde.org/pim/kdepim-runtime/-/commit/34965645e0c45e6addc6ff8898007e85d8cb081d

diff --git a/agents/newmailnotifier/specialnotifierjob.cpp b/agents/newmailnotifier/specialnotifierjob.cpp
index 9bdbc9882..d631ac1c7 100644
--- a/agents/newmailnotifier/specialnotifierjob.cpp
+++ b/agents/newmailnotifier/specialnotifierjob.cpp
@@ -75,12 +75,12 @@ void SpecialNotifierJob::slotItemFetchJobDone(KJob *job)
 void SpecialNotifierJob::slotSearchJobFinished(KJob *job)
 {
     const Akonadi::ContactSearchJob *searchJob = qobject_cast<Akonadi::ContactSearchJob *>(job);
-    if (searchJob->error()) {
+    if (searchJob && searchJob->error()) {
         qCWarning(NEWMAILNOTIFIER_LOG) << "Unable to fetch contact:" << searchJob->errorText();
         emitNotification();
         return;
     }
-    if (!searchJob->contacts().isEmpty()) {
+    if (searchJob && !searchJob->contacts().isEmpty()) {
         const KContacts::Addressee addressee = searchJob->contacts().at(0);
         const KContacts::Picture photo = addressee.photo();
         const QImage image = photo.data();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.