You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Fix error when dragging non-resource file
This commit is contained in:
@@ -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<String> 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user