Skip to content

Commit 76b44eb

Browse files
committed
Merge pull request #112339 from AdvanceControl/fix_no_icon_class
Fix crash for classes without an icon
2 parents 85082bb + 8a6d044 commit 76b44eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

editor/doc/editor_help.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,10 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum, bool p_is
471471

472472
void EditorHelp::_add_type_icon(const String &p_type, int p_size, const String &p_fallback) {
473473
Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(p_type, p_fallback);
474+
if (icon.is_null()) {
475+
icon = EditorNode::get_singleton()->get_class_icon("Object");
476+
ERR_FAIL_COND(icon.is_null());
477+
}
474478
Vector2i size = Vector2i(icon->get_width(), icon->get_height());
475479
if (p_size > 0) {
476480
// Ensures icon scales proportionally on both axes, based on icon height.

0 commit comments

Comments
 (0)