diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-17 20:17:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-17 20:17:02 +0100 |
commit | 91909ef801efe97f87faa1a46bee4eac352b6649 (patch) | |
tree | d06a7b24f86c5d86bbdb666408a571aed294fc44 /modules | |
parent | 12ab19fa26e85c9dbaedc0ccc25143a04527504e (diff) | |
parent | 3033e0f8a28f2f8dce5a50b077cb645433317d03 (diff) |
Merge pull request #55625 from cdemirer/fix-type-guessing-and-gdscript-parser-printing
Fix `--test gdscript-parser` crash
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 10f1dd0a41..5e210074ed 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -4236,7 +4236,11 @@ void GDScriptParser::TreePrinter::print_get_node(GetNodeNode *p_get_node) { } void GDScriptParser::TreePrinter::print_identifier(IdentifierNode *p_identifier) { - push_text(p_identifier->name); + if (p_identifier != nullptr) { + push_text(p_identifier->name); + } else { + push_text("<invalid identifier>"); + } } void GDScriptParser::TreePrinter::print_if(IfNode *p_if, bool p_is_elif) { |