2
0
Эх сурвалжийг харах

Merge pull request #46699 from sps1112/fix-control.edit_set_state-crash

Add size and dictionary check in Control::_edit_set_state() to fix crash
Rémi Verschelde 4 жил өмнө
parent
commit
02ae0afe63
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      scene/gui/control.cpp

+ 3 - 0
scene/gui/control.cpp

@@ -73,6 +73,9 @@ Dictionary Control::_edit_get_state() const {
 }
 
 void Control::_edit_set_state(const Dictionary &p_state) {
+	ERR_FAIL_COND((p_state.size() <= 0) ||
+				  !p_state.has("rotation") || !p_state.has("scale") ||
+				  !p_state.has("pivot") || !p_state.has("anchors") || !p_state.has("offsets"));
 	Dictionary state = p_state;
 
 	set_rotation(state["rotation"]);