diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index a11c35e5f25..b1e8ce20d6d 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5528,6 +5528,7 @@ void CanvasItemEditorViewport::_create_preview(const Vector &files) cons for (int i = 0; i < files.size(); i++) { String path = files[i]; RES res = ResourceLoader::load(path); + ERR_FAIL_COND(res.is_null()); Ref texture = Ref(Object::cast_to(*res)); Ref scene = Ref(Object::cast_to(*res)); if (texture != NULL || scene != NULL) { diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index ba40fc56125..9a479b823b6 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -3230,6 +3230,7 @@ void SpatialEditorViewport::_create_preview(const Vector &files) const { for (int i = 0; i < files.size(); i++) { String path = files[i]; RES res = ResourceLoader::load(path); + ERR_CONTINUE(res.is_null()); Ref scene = Ref(Object::cast_to(*res)); Ref mesh = Ref(Object::cast_to(*res)); if (mesh != NULL || scene != NULL) { @@ -3279,6 +3280,7 @@ bool SpatialEditorViewport::_cyclical_dependency_exists(const String &p_target_s bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) { RES res = ResourceLoader::load(path); + ERR_FAIL_COND_V(res.is_null(), false); Ref scene = Ref(Object::cast_to(*res)); Ref mesh = Ref(Object::cast_to(*res)); diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index e8cd7692b64..d4f985e1de3 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -380,6 +380,7 @@ void VersionControlEditorPlugin::fetch_available_vcs_addon_names() { String path = ScriptServer::get_global_class_path(global_classes[i]); Ref