1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fixing null callee crash.

This commit is contained in:
Stephen Nichols
2020-08-05 14:41:46 -05:00
parent 6831da630f
commit 8a13be50ab
4 changed files with 30 additions and 15 deletions

View File

@@ -2419,7 +2419,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) {