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 <ci_patchbuild_bot@qt.io>
Reviewed-by: Aleksei German <aleksei.german@qt.io>
This commit is contained in:
Ali Kianian
2023-09-19 17:33:10 +03:00
parent 949612c23e
commit ff02efe541

View File

@@ -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) {