diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index a8f4b5b4343..5bbc4b6ea85 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -1024,10 +1024,12 @@ String EditorData::script_class_get_icon_path(const String &p_class, bool *r_val } HashMap::ConstIterator E = _script_class_icon_paths.find(current); if ((bool)E) { - if (r_valid && !E->value.is_empty()) { - *r_valid = true; + if (r_valid) { + *r_valid = !E->value.is_empty(); + return E->value; + } else if (!E->value.is_empty()) { + return E->value; } - return E->value; } current = ScriptServer::get_global_class_base(current); }