Skip to content

Commit 529a5a3

Browse files
committed
Fix error when dragging non-resource file
1 parent 1d8e738 commit 529a5a3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

editor/inspector/editor_resource_picker.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,11 @@ bool EditorResourcePicker::_is_drop_valid(const Dictionary &p_drag_data) const {
737737
} else if (drag_data.has("type") && String(drag_data["type"]) == "files") {
738738
Vector<String> files = drag_data["files"];
739739

740-
// TODO: Extract the typename of the dropped filepath's resource in a more performant way, without fully loading it.
741740
if (files.size() == 1) {
742-
res = ResourceLoader::load(files[0]);
741+
if (ResourceLoader::exists(files[0])) {
742+
// TODO: Extract the typename of the dropped filepath's resource in a more performant way, without fully loading it.
743+
res = ResourceLoader::load(files[0]);
744+
}
743745
}
744746
}
745747

0 commit comments

Comments
 (0)