Merge pull request #51473 from KoBeWi/some_crash_fix_idk

Fix crash when parsing Dictionary
This commit is contained in:
Rémi Verschelde 2021-08-10 18:54:45 +02:00 committed by GitHub
commit b205a20bb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)) {