From c7452a9940d98351d235aa7c559ea54ec82b5c74 Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 24 Aug 2021 13:19:40 +0200 Subject: Fix crash with consecutive commas in Dictionary --- modules/gdscript/gdscript_parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/gdscript/gdscript_parser.cpp') diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 4f275ca240..25083a1f0a 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2462,8 +2462,10 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode push_error(R"(Expected "=" after dictionary key.)"); } } - key->is_constant = true; - key->reduced_value = static_cast(key)->name; + if (key != nullptr) { + key->is_constant = true; + key->reduced_value = static_cast(key)->name; + } break; case DictionaryNode::PYTHON_DICT: if (!match(GDScriptTokenizer::Token::COLON)) { -- cgit v1.2.3