[pim/pim-sieve-editor] src: Fix crash in release mode

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 030021c628ea95b49c1d53646424f38492e2c956 by Laurent Montel.
Committed on 14/08/2026 at 17:46.
Pushed by mlaurent into branch 'master'.

Fix crash in release mode

M  +7    -4    src/readserversieveconfigjob.cpp

https://invent.kde.org/pim/pim-sieve-editor/-/commit/030021c628ea95b49c1d53646424f38492e2c956

diff --git a/src/readserversieveconfigjob.cpp b/src/readserversieveconfigjob.cpp
index 5aaeda2b..45f3046f 100644
--- a/src/readserversieveconfigjob.cpp
+++ b/src/readserversieveconfigjob.cpp
@@ -92,11 +92,14 @@ void ReadServerSieveConfigJob::loadImapAccountSettings()
 void ReadServerSieveConfigJob::readImapPasswordFinished(QKeychain::Job *baseJob)
 {
     auto job = qobject_cast<ReadPasswordJob *>(baseJob);
-    Q_ASSERT(job);
-    if (!job->error()) {
-        mCurrentSieveServerConfig.sieveImapAccountSettings.setPassword(job->textData());
+    if (job) {
+        if (!job->error()) {
+            mCurrentSieveServerConfig.sieveImapAccountSettings.setPassword(job->textData());
+        } else {
+            qCWarning(SIEVEEDITOR_LOG) << "We have an error during reading password (imap) " << job->errorString();
+        }
     } else {
-        qCWarning(SIEVEEDITOR_LOG) << "We have an error during reading password (imap) " << job->errorString();
+        qCWarning(SIEVEEDITOR_LOG) << "We have an error during reading password (imap) job is null";
     }
     mLstConfig.append(mCurrentSieveServerConfig);
     Q_EMIT loadNextConfig();
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.