From 529a5a3512a3592118e51c5e60bff022ed92cfe9 Mon Sep 17 00:00:00 2001 From: Lindo Date: Tue, 15 Jul 2025 22:28:38 +0200 Subject: [PATCH] Fix error when dragging non-resource file --- editor/inspector/editor_resource_picker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/inspector/editor_resource_picker.cpp b/editor/inspector/editor_resource_picker.cpp index 0a8dfc36706..141c05498eb 100644 --- a/editor/inspector/editor_resource_picker.cpp +++ b/editor/inspector/editor_resource_picker.cpp @@ -737,9 +737,11 @@ bool EditorResourcePicker::_is_drop_valid(const Dictionary &p_drag_data) const { } else if (drag_data.has("type") && String(drag_data["type"]) == "files") { Vector files = drag_data["files"]; - // TODO: Extract the typename of the dropped filepath's resource in a more performant way, without fully loading it. if (files.size() == 1) { - res = ResourceLoader::load(files[0]); + if (ResourceLoader::exists(files[0])) { + // TODO: Extract the typename of the dropped filepath's resource in a more performant way, without fully loading it. + res = ResourceLoader::load(files[0]); + } } }