From ff02efe5413edf5f756e7b2a7b0340842bba0b06 Mon Sep 17 00:00:00 2001 From: Ali Kianian Date: Tue, 19 Sep 2023 17:33:10 +0300 Subject: [PATCH] QmlDesigner: Fix the crash on visiting callExpression Fixed the bug for visiting a callExpression outside of the statement. Task-number: QDS-10708 Change-Id: Iebe8c1c8d73f1d601e1fba6adaca1ce89d89d0ff Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Aleksei German --- .../components/connectioneditor/connectioneditorevaluator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectioneditorevaluator.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectioneditorevaluator.cpp index c7d3ae977a5..5bb96390253 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/connectioneditorevaluator.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/connectioneditorevaluator.cpp @@ -967,11 +967,11 @@ bool ConnectionEditorEvaluator::visit(QmlJS::AST::FieldMemberExpression *fieldEx bool ConnectionEditorEvaluator::visit(QmlJS::AST::CallExpression *callExpression) { if (d->isInIfCondition()) - d->checkValidityAndReturn(false, "Functions are not allowd in the expressions"); + return d->checkValidityAndReturn(false, "Functions are not allowd in the expressions"); MatchedStatement *currentStatement = d->currentStatement(); if (!currentStatement) - d->checkValidityAndReturn(false, "Invalid place to call an expression"); + return d->checkValidityAndReturn(false, "Invalid place to call an expression"); if (ConnectionEditorStatements::isEmptyStatement(*currentStatement)) { if (d->parentNodeStatus().childId() == 0) {