summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-12 09:46:03 +0100
committerGitHub <noreply@github.com>2021-03-12 09:46:03 +0100
commit02ae0afe634a683417ff310cdcb13f45a2dca424 (patch)
tree8cd9723e6b0afb7afb8f42fd15a3d3e374671833 /scene/gui
parentfec979b850e0bcb63195bfa5f518557b18e9c5b4 (diff)
parent05f5a43cad08fa98e6a7225011186ec8b2b9ea2a (diff)
Merge pull request #46699 from sps1112/fix-control.edit_set_state-crash
Add size and dictionary check in Control::_edit_set_state() to fix crash
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/control.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index bff3024e38..f188e63743 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -73,6 +73,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"]);