From 8a6d044fa1464cacb836de44bc23042397006e50 Mon Sep 17 00:00:00 2001 From: AdvanceControl <163237388+AdvanceControl@users.noreply.github.com> Date: Mon, 3 Nov 2025 18:38:36 +0800 Subject: [PATCH] Fix crash for classes without an icon --- editor/doc/editor_help.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/doc/editor_help.cpp b/editor/doc/editor_help.cpp index 3956fd45ee5..fa930d48b86 100644 --- a/editor/doc/editor_help.cpp +++ b/editor/doc/editor_help.cpp @@ -471,6 +471,10 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum, bool p_is void EditorHelp::_add_type_icon(const String &p_type, int p_size, const String &p_fallback) { Ref icon = EditorNode::get_singleton()->get_class_icon(p_type, p_fallback); + if (icon.is_null()) { + icon = EditorNode::get_singleton()->get_class_icon("Object"); + ERR_FAIL_COND(icon.is_null()); + } Vector2i size = Vector2i(icon->get_width(), icon->get_height()); if (p_size > 0) { // Ensures icon scales proportionally on both axes, based on icon height.