Skip to content

Commit 94d7a54

Browse files
committed
Merge pull request #107402 from mihe/lsp-uid-bug
Stop `FileAccess::fix_path` from emitting errors for invalid UIDs
2 parents ce3ebac + d160d71 commit 94d7a54

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/io/file_access.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,12 @@ String FileAccess::fix_path(const String &p_path) const {
258258
case ACCESS_RESOURCES: {
259259
if (ProjectSettings::get_singleton()) {
260260
if (r_path.begins_with("uid://")) {
261-
r_path = ResourceUID::uid_to_path(r_path);
261+
ResourceUID::ID uid = ResourceUID::get_singleton()->text_to_id(r_path);
262+
if (ResourceUID::get_singleton()->has_id(uid)) {
263+
r_path = ResourceUID::get_singleton()->get_id_path(uid);
264+
} else {
265+
r_path.clear();
266+
}
262267
}
263268

264269
if (r_path.begins_with("res://")) {

0 commit comments

Comments
 (0)