[pim/messagelib] messageviewer/src/viewer: Avoid to execute twice code

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

Avoid to execute twice code

M  +3    -2    messageviewer/src/viewer/urlhandlermanager.cpp

https://invent.kde.org/pim/messagelib/-/commit/258aa1fbc031c3ac3bb6ee0e6c35dc202e136a6b

diff --git a/messageviewer/src/viewer/urlhandlermanager.cpp b/messageviewer/src/viewer/urlhandlermanager.cpp
index 6b51d1255..8e402cd57 100644
--- a/messageviewer/src/viewer/urlhandlermanager.cpp
+++ b/messageviewer/src/viewer/urlhandlermanager.cpp
@@ -789,8 +789,9 @@ static QString extractAuditLog(const QUrl &url)
         return {};
     }
     QUrlQuery query(url);
-    Q_ASSERT(!query.queryItemValue(u"log"_s).isEmpty());
-    return query.queryItemValue(u"log"_s);
+    const QString value = query.queryItemValue(u"log"_s);
+    Q_ASSERT(!value.isEmpty());
+    return value;
 }
 
 bool ShowAuditLogURLHandler::handleClick(const QUrl &url, ViewerPrivate *w) const
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.