diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-03 12:45:43 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-03 12:45:43 +0100 |
commit | 4a262209a121393df208b28570ac79f697b1b0f2 (patch) | |
tree | 13e9cd6b0d1b213c4339359e92eec69ce9407c9d /modules/gdscript | |
parent | b8e5b16506b92d0de8b4e1975b0af6e5697c1c1c (diff) | |
parent | 7bcaa9df9ea82a67db631f97a25ee3015475dc3b (diff) |
Merge pull request #69520 from adamscott/fix-missing-parent-class-identifier
Fix missing parent class name identifier crash
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index dff6e41dca..663d72038d 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -196,8 +196,11 @@ Error GDScriptAnalyzer::check_class_member_name_conflict(const GDScriptParser::C while (current_data_type && current_data_type->kind == GDScriptParser::DataType::Kind::CLASS) { GDScriptParser::ClassNode *current_class_node = current_data_type->class_type; if (has_member_name_conflict_in_script_class(p_member_name, current_class_node, p_member_node)) { - push_error(vformat(R"(The member "%s" already exists in parent class %s.)", p_member_name, current_class_node->identifier->name), - p_member_node); + String parent_class_name = current_class_node->fqcn; + if (current_class_node->identifier != nullptr) { + parent_class_name = current_class_node->identifier->name; + } + push_error(vformat(R"(The member "%s" already exists in parent class %s.)", p_member_name, parent_class_name), p_member_node); return ERR_PARSE_ERROR; } current_data_type = ¤t_class_node->base_type; |