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

Add size check in Control::_edit_set_state()  to fix crash
This commit is contained in:
Rémi Verschelde 2021-03-04 07:46:16 +01:00 committed by GitHub
commit 8ff25ffb78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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