Przeglądaj źródła

Fix Control._edit_set_state crash

(cherry picked from commit 05f5a43cad08fa98e6a7225011186ec8b2b9ea2a)
sps1112 4 lat temu
rodzic
commit
f8ee8b1b73
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      scene/gui/control.cpp

+ 3 - 1
scene/gui/control.cpp

@@ -70,7 +70,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"]);