diff options
author | cdemirer <41021322+cdemirer@users.noreply.github.com> | 2022-01-03 08:47:18 +0800 |
---|---|---|
committer | cdemirer <41021322+cdemirer@users.noreply.github.com> | 2022-01-03 08:47:18 +0800 |
commit | 3033e0f8a28f2f8dce5a50b077cb645433317d03 (patch) | |
tree | 961f1a091a177deeb8ea9385e93610771cfff79f | |
parent | 2a9dd654bc0197dd864df61b5b37e302022c2871 (diff) |
Fix gdscript-parser crash
Fixes gdscript-parser crashing while printing empty identifiers.
-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 fd6bd545c9..e1d15e5d7a 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -4221,7 +4221,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) { |