From 282f873e4074dbd21574ef21cc42aca31ed265a9 Mon Sep 17 00:00:00 2001 From: aurpine Date: Wed, 15 Apr 2026 14:03:11 -0400 Subject: [PATCH] Fix match dictionary no value print_match_pattern --- modules/gdscript/gdscript_parser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 4777ff8c28..468fc8d365 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -6216,9 +6216,12 @@ void GDScriptParser::TreePrinter::print_match_pattern(PatternNode *p_match_patte if (p_match_pattern->dictionary[i].key != nullptr) { // Key can be null for rest pattern. print_expression(p_match_pattern->dictionary[i].key); - push_text(" : "); + if (p_match_pattern->dictionary[i].value_pattern != nullptr) { + // Value can be null when only matching key. + push_text(" : "); + print_match_pattern(p_match_pattern->dictionary[i].value_pattern); + } } - print_match_pattern(p_match_pattern->dictionary[i].value_pattern); } push_text(" }"); break;