mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Merge pull request #41055 from snichols/null-callee-fix
Fix crash with null callee
This commit is contained in:
commit
cf05486d8e
4 changed files with 35 additions and 16 deletions
|
|
@ -2332,7 +2332,11 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
|
|||
GDScriptParser::ExpressionNode *GDScriptParser::parse_grouping(ExpressionNode *p_previous_operand, bool p_can_assign) {
|
||||
ExpressionNode *grouped = parse_expression(false);
|
||||
pop_multiline();
|
||||
consume(GDScriptTokenizer::Token::PARENTHESIS_CLOSE, R"*(Expected closing ")" after grouping expression.)*");
|
||||
if (grouped == nullptr) {
|
||||
push_error(R"(Expected grouping expression.)");
|
||||
} else {
|
||||
consume(GDScriptTokenizer::Token::PARENTHESIS_CLOSE, R"*(Expected closing ")" after grouping expression.)*");
|
||||
}
|
||||
return grouped;
|
||||
}
|
||||
|
||||
|
|
@ -2423,7 +2427,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre
|
|||
} else {
|
||||
call->callee = p_previous_operand;
|
||||
|
||||
if (call->callee->type == Node::IDENTIFIER) {
|
||||
if (call->callee == nullptr) {
|
||||
push_error(R"*(Cannot call on an expression. Use ".call()" if it's a Callable.)*");
|
||||
} else if (call->callee->type == Node::IDENTIFIER) {
|
||||
call->function_name = static_cast<IdentifierNode *>(call->callee)->name;
|
||||
make_completion_context(COMPLETION_METHOD, call->callee);
|
||||
} else if (call->callee->type == Node::SUBSCRIPT) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue