Repository: godotengine/godot (language: cpp)

Issue:
'@icon' not inheriting
### Tested versions

v4.4.beta3.official [06acfccf8] - issue is present
v4.4.beta2.official [a013481b0] - issue is NOT present. This is a recent issue.

### System information

Godot v4.4.beta3 - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Mobile) - dedicated AMD Radeon RX 6600 (Advanced Micro Devices, Inc.; 32.0.11027.2001) - AMD Ryzen 5 3600 6-Core Processor (12 threads)

### Issue description

A script of mine uses `@icon("res://editor/icons/base_scene.svg")` to give it a custom icon in the editor. There are other scripts which `extend` this script, which, previously, also showed this icon, without needing to specify it themselves in every script file.

This is no longer the case, with the child scripts now using the default icon.

![Image](https://github.com/user-attachments/assets/db535219-b27a-47db-9b84-0ccf7acdcd9a)
(`base_scene` is a `BaseScene` script, showing the icon correctly. `factory_spawn` is a `BaseFactoryScene` script, which `extends BaseScene`, yet it does NOT show the icon correctly)

### Steps to reproduce

1. Set a custom `@icon` on a class.
2. Extend that class.
3. Note that the extended class ignores the icon.

### Minimal reproduction project (MRP)

N/A


Discussion / hints:

Fix patch:
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index f31e6aba4169..8135a9b96644 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -1023,7 +1023,7 @@ String EditorData::script_class_get_icon_path(const String &p_class, bool *r_val
 			return String();
 		}
 		HashMap<StringName, String>::ConstIterator E = _script_class_icon_paths.find(current);
-		if ((bool)E) {
+		if ((bool)E && !E->value.is_empty()) {
 			if (r_valid) {
 				*r_valid = true;
 			}


Test patch: