forked from qt-creator/qt-creator
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:
@@ -967,11 +967,11 @@ bool ConnectionEditorEvaluator::visit(QmlJS::AST::FieldMemberExpression *fieldEx
|
|||||||
bool ConnectionEditorEvaluator::visit(QmlJS::AST::CallExpression *callExpression)
|
bool ConnectionEditorEvaluator::visit(QmlJS::AST::CallExpression *callExpression)
|
||||||
{
|
{
|
||||||
if (d->isInIfCondition())
|
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();
|
MatchedStatement *currentStatement = d->currentStatement();
|
||||||
if (!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 (ConnectionEditorStatements::isEmptyStatement(*currentStatement)) {
|
||||||
if (d->parentNodeStatus().childId() == 0) {
|
if (d->parentNodeStatus().childId() == 0) {
|
||||||
|
Reference in New Issue
Block a user