Fix crash when parsing Dictionary

This commit is contained in:
kobewi 2021-08-10 15:32:07 +02:00
parent 50d5569ad4
commit e0572f7ef7

View File

@ -2480,7 +2480,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
switch (dictionary->style) {
case DictionaryNode::LUA_TABLE:
if (key != nullptr && key->type != Node::IDENTIFIER) {
push_error("Expected identifier as dictionary key.");
push_error("Expected identifier as LUA-style dictionary key.");
advance();
break;
}
if (!match(GDScriptTokenizer::Token::EQUAL)) {
if (match(GDScriptTokenizer::Token::COLON)) {