diff --git a/editor/scene/material_editor_plugin.cpp b/editor/scene/material_editor_plugin.cpp index 200ec8c85f3..a5554ebe295 100644 --- a/editor/scene/material_editor_plugin.cpp +++ b/editor/scene/material_editor_plugin.cpp @@ -52,7 +52,6 @@ Ref MaterialEditor::make_shader_material(const Ref &p_from, bool p_copy_params) { ERR_FAIL_COND_V(p_from.is_null(), Ref()); - ERR_FAIL_COND_V(!p_from->_is_initialized(), Ref()); Ref smat; smat.instantiate(); @@ -497,5 +496,6 @@ bool CanvasItemMaterialConversionPlugin::handles(const Ref &p_resource } Ref CanvasItemMaterialConversionPlugin::convert(const Ref &p_resource) const { + ERR_FAIL_COND_V(!Object::cast_to(*p_resource) || !Object::cast_to(*p_resource)->_is_initialized(), Ref()); return MaterialEditor::make_shader_material(p_resource); }