ProjectExplorer: Do not pass invalid regex to match

Change-Id: I9917c9fa7a79132c253269efde90976e18f9b805
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2020-08-07 15:26:51 +02:00
parent 63823a55ac
commit acadee710e

View File

@@ -278,7 +278,8 @@ bool CustomParserConfigDialog::checkPattern(QLineEdit *pattern, const QString &o
pattern->setPalette(palette);
pattern->setToolTip(rx.isValid() ? QString() : rx.errorString());
*match = rx.match(outputText);
if (rx.isValid())
*match = rx.match(outputText);
if (rx.pattern().isEmpty() || !rx.isValid() || !match->hasMatch()) {
*errorMessage = QString::fromLatin1("<font color=\"%1\">%2 ").arg(
Utils::creatorTheme()->color(Utils::Theme::TextColorError).name(),