diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-01-25 14:44:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-25 14:44:30 +0100 |
commit | 7cbe1835f97ba8753ce3230537428aa42606ec88 (patch) | |
tree | 786add87d051f56cb233f32c9d125c421af56360 | |
parent | 3102660512e2808e2f133a6edc1c3d74202e76c4 (diff) | |
parent | 306b98638e3d8f52ff7bdf639fbd4a478dfc8913 (diff) |
Merge pull request #57189 from bruvzg/fix_shortcut_context_unset
-rw-r--r-- | scene/gui/base_button.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index bcb2b0c50e..5f937acb8d 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -382,8 +382,11 @@ Ref<ButtonGroup> BaseButton::get_button_group() const { } void BaseButton::set_shortcut_context(Node *p_node) { - ERR_FAIL_NULL_MSG(p_node, "Shortcut context node can't be null."); - shortcut_context = p_node->get_instance_id(); + if (p_node != nullptr) { + shortcut_context = p_node->get_instance_id(); + } else { + shortcut_context = ObjectID(); + } } Node *BaseButton::get_shortcut_context() const { |