1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #84148 from KANAjetzt/fix_crash_take_over_path_named_class

Fix crash when extending taken-over named class
This commit is contained in:
Rémi Verschelde
2024-05-07 13:48:36 +02:00

View File

@@ -2666,7 +2666,10 @@ Error GDScriptCompiler::_prepare_compilation(GDScript *p_script, const GDScriptP
GDScriptDataType base_type = _gdtype_from_datatype(p_class->base_type, p_script, false); GDScriptDataType base_type = _gdtype_from_datatype(p_class->base_type, p_script, false);
ERR_FAIL_COND_V_MSG(base_type.native_type == StringName(), ERR_BUG, vformat(R"(Failed to get base class for "%s")", p_script->path));
int native_idx = GDScriptLanguage::get_singleton()->get_global_map()[base_type.native_type]; int native_idx = GDScriptLanguage::get_singleton()->get_global_map()[base_type.native_type];
p_script->native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx]; p_script->native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx];
ERR_FAIL_COND_V(p_script->native.is_null(), ERR_BUG); ERR_FAIL_COND_V(p_script->native.is_null(), ERR_BUG);