Repository: godotengine/godot (language: cpp)

Issue:
Project manager unable to resolve icon referenced by uid before import
### Tested versions

4.4-beta1

### System information

(Native)
Godot v4.4.beta1 - Windows 10 (build 19045) - Multi-window, 2 monitors - OpenGL 3 (Compatibility) - NVIDIA GeForce RTX 4070 (NVIDIA; 32.0.15.6636) - AMD Ryzen 9 3950X 16-Core Processor (32 threads)

(WSL2 on above system)
Godot v4.4.beta1 - Ubuntu 24.04.1 LTS 24.04 - X11 display driver, Multi-window, 2 monitors - OpenGL 3 (Compatibility) - D3D12 (NVIDIA GeForce RTX 4070) - AMD Ryzen 9 3950X 16-Core Processor (32 threads)

### Issue description

The project manager is unable to resolve an icon referenced by uid before first import:
```
ERROR: Unrecognized UID: "uid://b3xkos3u4jns4".
   at: get_id_path (core/io/resource_uid.cpp:157)
ERROR: Error opening file ''.
   at: load_image (core/io/image_loader.cpp:89)
```


### Steps to reproduce

open project manager
import MRP without "Edit Now"
-> no icon, errors in console

### Minimal reproduction project (MRP)

[icontest44b1.zip](https://github.com/user-attachments/files/18464271/icontest44b1.zip)


Discussion / hints:
I can reproduce it too on Linux in the latest `master` branch (261e7d32d37445de3ef3a9804346552fdac6096e), including after the related #102513 was merged.

I'm afraid this can't really be solved if we save icons as UIDs, because UIDs aren't known outside the project, so the Project Manager can't resolve them.

Well actually I see @KoBeWi added some loading of the UID cache from the PM in #100717. That might have been a bit of a bazooka solution in hindsight... but we see its shortcoming here.

Another option would be to simply enforce that the icon is always saved as a path and not UID, so it can be parsed by external tools like the PM. We could even consider having that restriction for other resources in `project.godot` like the main scene.
The issue only happens when project is not imported yet, so it won't affect majority of the projects. Usually when you have a project in your project list it was already imported; unless you just batch added multiple projects, which I think does not happen that often.

We could silence the error if cache does not exist yet, because it's not useful.
Yeah silencing the error and just displaying default icon might be a good compromise.

Fix patch:
diff --git a/editor/project_manager/project_list.cpp b/editor/project_manager/project_list.cpp
index a4d3628d1793..b96e40b0b73e 100644
--- a/editor/project_manager/project_list.cpp
+++ b/editor/project_manager/project_list.cpp
@@ -502,6 +502,9 @@ ProjectList::Item ProjectList::load_project_data(const String &p_path, bool p_fa
 			if (icon.is_empty()) {
 				WARN_PRINT(vformat("Could not load icon from UID for project at path \"%s\". Make sure UID cache exists.", p_path));
 			}
+		} else {
+			// Cache does not exist yet, so ignore and fallback to default icon.
+			icon = "";
 		}
 	}
 


Test patch: