1
0
Fork 0

Merge pull request #108645 from Changryy/check-resource-before-load

Fix error when dragging non-resource file
This commit is contained in:
Thaddeus Crews 2025-07-18 11:05:07 -05:00
commit 74ee47e31e
No known key found for this signature in database
GPG Key ID: 8C6E5FEB5FC03CCC
1 changed files with 4 additions and 2 deletions

View File

@ -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]);
}
}
}