Add size check in Control._edit_set_state to prevent crash
This commit is contained in:
parent
4d1f83a621
commit
ef1d58f034
1 changed files with 4 additions and 0 deletions
|
@ -73,6 +73,10 @@ Dictionary Control::_edit_get_state() const {
|
|||
}
|
||||
|
||||
void Control::_edit_set_state(const Dictionary &p_state) {
|
||||
ERR_FAIL_COND((p_state.size() <= 0) ||
|
||||
p_state["rotation"].is_null() || p_state["scale"].is_null() ||
|
||||
p_state["pivot"].is_null() || p_state["anchors"].is_null() || p_state["offsets"].is_null());
|
||||
|
||||
Dictionary state = p_state;
|
||||
|
||||
set_rotation(state["rotation"]);
|
||||
|
|
Loading…
Reference in a new issue