Merge pull request #58275 from V-Sekai/attribute_parse_crash_fix

This commit is contained in:
Rémi Verschelde 2022-02-21 12:17:14 +01:00 committed by GitHub
commit d42250e2fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2692,12 +2692,13 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_attribute(ExpressionNode *
} }
} }
attribute->is_attribute = true;
attribute->base = p_previous_operand; attribute->base = p_previous_operand;
if (!consume(GDScriptTokenizer::Token::IDENTIFIER, R"(Expected identifier after "." for attribute access.)")) { if (!consume(GDScriptTokenizer::Token::IDENTIFIER, R"(Expected identifier after "." for attribute access.)")) {
return attribute; return attribute;
} }
attribute->is_attribute = true;
attribute->attribute = parse_identifier(); attribute->attribute = parse_identifier();
return attribute; return attribute;