Skip to content

Commit

Permalink
Merge pull request #46620 from sps1112/fix-control.edit_set_state-crash
Browse files Browse the repository at this point in the history
Add size check in Control::_edit_set_state()  to fix crash
  • Loading branch information
akien-mga authored Mar 4, 2021
2 parents 44e7347 + ef1d58f commit 8ff25ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
Expand Down

0 comments on commit 8ff25ff

Please sign in to comment.