diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 6b5cc484e4f..974dcdf656a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6035,11 +6035,13 @@ Dictionary EditorNode::drag_resource(const Ref &p_res, Control *p_from { // TODO: make proper previews - Ref texture = theme->get_icon(SNAME("FileBigThumb"), EditorStringName(EditorIcons)); - Ref img = texture->get_image(); - img = img->duplicate(); - img->resize(48, 48); // meh - preview = ImageTexture::create_from_image(img); + Ref texture = theme->get_icon(SNAME("FileBigThumb"), EditorStringName(EditorIcons)); + if (texture.is_valid()) { + Ref img = texture->get_image(); + img = img->duplicate(); + img->resize(48, 48); // meh + preview = ImageTexture::create_from_image(img); + } } drag_preview->set_texture(preview);