Merge pull request #57189 from bruvzg/fix_shortcut_context_unset

This commit is contained in:
Rémi Verschelde 2022-01-25 14:44:30 +01:00 committed by GitHub
commit 7cbe1835f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -382,8 +382,11 @@ Ref<ButtonGroup> BaseButton::get_button_group() const {
} }
void BaseButton::set_shortcut_context(Node *p_node) { void BaseButton::set_shortcut_context(Node *p_node) {
ERR_FAIL_NULL_MSG(p_node, "Shortcut context node can't be null."); if (p_node != nullptr) {
shortcut_context = p_node->get_instance_id(); shortcut_context = p_node->get_instance_id();
} else {
shortcut_context = ObjectID();
}
} }
Node *BaseButton::get_shortcut_context() const { Node *BaseButton::get_shortcut_context() const {