Skip to content

Commit

Permalink
Fixes a crash when creating a script which inherits from a class defi…
Browse files Browse the repository at this point in the history
…ned with class_name
  • Loading branch information
SaracenOne committed Aug 9, 2021
1 parent e010e05 commit 002eace
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/gdscript/gdscript_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ GDScriptDataType GDScriptCompiler::_gdtype_from_datatype(const GDScriptParser::D
// Locate class by constructing the path to it and following that path
GDScriptParser::ClassNode *class_type = p_datatype.class_type;
if (class_type) {
if (class_type->fqcn.begins_with(main_script->path) || (!main_script->name.is_empty() && class_type->fqcn.begins_with(main_script->name))) {
if ((!main_script->path.is_empty() && class_type->fqcn.begins_with(main_script->path) ||
(!main_script->name.is_empty() && class_type->fqcn.begins_with(main_script->name)))) {
// Local class.
List<StringName> names;
while (class_type->outer) {
Expand Down

0 comments on commit 002eace

Please sign in to comment.