Skip to content

Commit

Permalink
Add size check in Control._edit_set_state to prevent crash
Browse files Browse the repository at this point in the history
  • Loading branch information
sps1112 committed Mar 4, 2021
1 parent 4d1f83a commit ef1d58f
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 ef1d58f

Please sign in to comment.