Make 'is_attribute' false during parse error to prevent crash

This commit is contained in:
SaracenOne 2022-02-18 12:52:46 +00:00
parent 887d4bd0d9
commit ae0026bc7b

View file

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