[pim/kdepim-addons] sieveeditor/emaillineedit: Verify if it's not empty before adding it

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

Verify if it's not empty before adding it

M  +3    -1    sieveeditor/emaillineedit/emaillineedit.cpp

https://invent.kde.org/pim/kdepim-addons/-/commit/92468c26e6b7876b63814ac12cad08aef008df7e

diff --git a/sieveeditor/emaillineedit/emaillineedit.cpp b/sieveeditor/emaillineedit/emaillineedit.cpp
index 11c486679..cd89506dd 100644
--- a/sieveeditor/emaillineedit/emaillineedit.cpp
+++ b/sieveeditor/emaillineedit/emaillineedit.cpp
@@ -67,7 +67,9 @@ void EmailLineEdit::insertAddresses(const KContacts::Addressee::List &list)
         } else {
             firstElement = false;
         }
-        currentText.append(contact.preferredEmail());
+        if (const auto preferredEmail = contact.preferredEmail(); !preferredEmail.isEmpty()) {
+            currentText.append(preferredEmail);
+        }
     }
     mLineEdit->setText(currentText);
 }
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.