diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-14 17:26:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 17:26:47 +0100 |
commit | f5f3f440f165d913279cc2cbb68d2483bf855d72 (patch) | |
tree | cd83d49fbc6dcca385c3028c5350dae212c25cc1 | |
parent | cdfd3ffe15dbf6f41bdade308d69a75f3d4eb3a7 (diff) | |
parent | a4afdd4a77f7d169f046416570bf60ab24c79845 (diff) |
Merge pull request #46024 from kleonc/rtl_add_image_fix
RichTextLabel::add_image Fail if passed image has no area
-rw-r--r-- | scene/gui/rich_text_label.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 89e01de517..992e272186 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2253,6 +2253,8 @@ void RichTextLabel::add_image(const Ref<Texture2D> &p_image, const int p_width, } ERR_FAIL_COND(p_image.is_null()); + ERR_FAIL_COND(p_image->get_width() == 0); + ERR_FAIL_COND(p_image->get_height() == 0); ItemImage *item = memnew(ItemImage); item->image = p_image; |