From 35d55954016ee9352802a2c33aa05058e5dce0a9 Mon Sep 17 00:00:00 2001
From: Andreas <andreas.hatziiliou@savoirfairelinux.com>
Date: Fri, 20 Sep 2024 10:19:58 -0400
Subject: [PATCH] searchbar: fix warnings for invalid regular expressions

Certain characters such as @ or < were being treated as invalid
regular expressions and caused warnings to be raised. Added check
for validity of expression.

GitLab: #1628

Change-Id: I8b66ebfcf029cd0568bccdcba96672d9005846a9
---
 src/app/conversationlistmodel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/app/conversationlistmodel.cpp b/src/app/conversationlistmodel.cpp
index 5ee54f9d5..0549cd2b7 100644
--- a/src/app/conversationlistmodel.cpp
+++ b/src/app/conversationlistmodel.cpp
@@ -143,7 +143,7 @@ ConversationListProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& s
         }
     } else {
         Q_FOREACH (const auto& filter, toFilter)
-            if (rx.match(filter).hasMatch()) {
+            if (rx.isValid() && rx.match(filter).hasMatch()) {
                 match = true;
                 break;
             }
-- 
GitLab