mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix crash for classes without an icon
This commit is contained in:
parent
06faefc9f4
commit
8a6d044fa1
1 changed files with 4 additions and 0 deletions
|
|
@ -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) {
|
void EditorHelp::_add_type_icon(const String &p_type, int p_size, const String &p_fallback) {
|
||||||
Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(p_type, p_fallback);
|
Ref<Texture2D> 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());
|
Vector2i size = Vector2i(icon->get_width(), icon->get_height());
|
||||||
if (p_size > 0) {
|
if (p_size > 0) {
|
||||||
// Ensures icon scales proportionally on both axes, based on icon height.
|
// Ensures icon scales proportionally on both axes, based on icon height.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue