Explorar o código

Fix crash after executing ItemList.set_icon_scale

(cherry picked from commit 8d0fa193c344be8e1ec801b1a45341801b80a5f8)
Haoyu Qiu %!s(int64=2) %!d(string=hai) anos
pai
achega
cf34580b90
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      scene/gui/item_list.cpp

+ 1 - 0
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;
 }