diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 5c512bc05d0..2df56724eeb 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1274,6 +1274,7 @@ bool ItemList::get_allow_reselect() const { } void ItemList::set_icon_scale(real_t p_scale) { + ERR_FAIL_COND(Math::is_nan(p_scale) || Math::is_inf(p_scale)); icon_scale = p_scale; }