You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Fix crash in Create New Node dialog with certain user-created scripts
This commit is contained in:
@@ -235,8 +235,6 @@ void CreateDialog::_add_type(const String &p_type, const TypeCategory p_type_cat
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ScriptServer::is_global_class(p_type)) {
|
if (ScriptServer::is_global_class(p_type)) {
|
||||||
inherits = EditorNode::get_editor_data().script_class_get_base(p_type);
|
|
||||||
if (inherits.is_empty()) {
|
|
||||||
Ref<Script> script = EditorNode::get_editor_data().script_class_load_script(p_type);
|
Ref<Script> script = EditorNode::get_editor_data().script_class_load_script(p_type);
|
||||||
ERR_FAIL_COND(script.is_null());
|
ERR_FAIL_COND(script.is_null());
|
||||||
|
|
||||||
@@ -248,6 +246,8 @@ void CreateDialog::_add_type(const String &p_type, const TypeCategory p_type_cat
|
|||||||
inherits = extends;
|
inherits = extends;
|
||||||
inherited_type = TypeCategory::CPP_TYPE;
|
inherited_type = TypeCategory::CPP_TYPE;
|
||||||
} else {
|
} else {
|
||||||
|
inherits = script->get_language()->get_global_class_name(base->get_path());
|
||||||
|
if (inherits.is_empty()) {
|
||||||
inherits = base->get_path();
|
inherits = base->get_path();
|
||||||
inherited_type = TypeCategory::PATH_TYPE;
|
inherited_type = TypeCategory::PATH_TYPE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user