From 7c8fb797452e2c12cff1375f5c139a797ac769e1 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 13 Jan 2023 11:59:03 +0400 Subject: [PATCH] Suppress a warnings spam when user entered an invalid regular expression --- apps/opencs/model/tools/search.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/opencs/model/tools/search.cpp b/apps/opencs/model/tools/search.cpp index 5598bc6a3c..624cfef82d 100644 --- a/apps/opencs/model/tools/search.cpp +++ b/apps/opencs/model/tools/search.cpp @@ -46,6 +46,10 @@ void CSMTools::Search::searchTextCell(const CSMWorld::IdTableBase* model, const void CSMTools::Search::searchRegExCell(const CSMWorld::IdTableBase* model, const QModelIndex& index, const CSMWorld::UniversalId& id, bool writable, CSMDoc::Messages& messages) const { + // TODO: verify regular expression before starting a search + if (!mRegExp.isValid()) + return; + QString text = model->data(index).toString(); QRegularExpressionMatchIterator i = mRegExp.globalMatch(text);