diff options
author | George Marques <george@gmarqu.es> | 2021-09-10 11:24:51 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 11:24:51 -0300 |
commit | 6423e891a683f34124ee10a31a1b9c464ec01b9b (patch) | |
tree | 1b7365ca2dbc2847a08dc976c42eecd93d5805df /modules/gdscript/gdscript_parser.cpp | |
parent | 6da061faf5dc20a9d0757983e6af1576ee1fc4df (diff) | |
parent | c7452a9940d98351d235aa7c559ea54ec82b5c74 (diff) | |
download | redot-engine-6423e891a683f34124ee10a31a1b9c464ec01b9b.tar.gz |
Merge pull request #52063 from KoBeWi/double_comma_of_doom
Fix crash with consecutive commas in Dictionary
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index d2b10f41e7..6c3d4367e4 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2464,8 +2464,10 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode push_error(R"(Expected "=" after dictionary key.)"); } } - key->is_constant = true; - key->reduced_value = static_cast<IdentifierNode *>(key)->name; + if (key != nullptr) { + key->is_constant = true; + key->reduced_value = static_cast<IdentifierNode *>(key)->name; + } break; case DictionaryNode::PYTHON_DICT: if (!match(GDScriptTokenizer::Token::COLON)) { |