You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
GDScript: Fix crash when autoload script can't be found
This commit is contained in:
@@ -657,6 +657,10 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type
|
|||||||
} else if (ProjectSettings::get_singleton()->has_autoload(first) && ProjectSettings::get_singleton()->get_autoload(first).is_singleton) {
|
} else if (ProjectSettings::get_singleton()->has_autoload(first) && ProjectSettings::get_singleton()->get_autoload(first).is_singleton) {
|
||||||
const ProjectSettings::AutoloadInfo &autoload = ProjectSettings::get_singleton()->get_autoload(first);
|
const ProjectSettings::AutoloadInfo &autoload = ProjectSettings::get_singleton()->get_autoload(first);
|
||||||
Ref<GDScriptParserRef> ref = get_parser_for(autoload.path);
|
Ref<GDScriptParserRef> ref = get_parser_for(autoload.path);
|
||||||
|
if (ref.is_null()) {
|
||||||
|
push_error(vformat(R"(The referenced autoload "%s" (from "%s") could not be loaded.)", first, autoload.path), p_type);
|
||||||
|
return bad_type;
|
||||||
|
}
|
||||||
if (ref->raise_status(GDScriptParserRef::INHERITANCE_SOLVED) != OK) {
|
if (ref->raise_status(GDScriptParserRef::INHERITANCE_SOLVED) != OK) {
|
||||||
push_error(vformat(R"(Could not parse singleton "%s" from "%s".)", first, autoload.path), p_type);
|
push_error(vformat(R"(Could not parse singleton "%s" from "%s".)", first, autoload.path), p_type);
|
||||||
return bad_type;
|
return bad_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user