1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

[3.x] Fix crashes when using _input functions

This commit is contained in:
Rafał Mikrut
2021-04-27 16:51:29 +02:00
parent 2d57df60f7
commit 06976c3e84
15 changed files with 18 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ void BaseButton::_unpress_group() {
}
void BaseButton::_gui_input(Ref<InputEvent> p_event) {
ERR_FAIL_COND(p_event.is_null());
if (status.disabled) // no interaction with disabled button
return;
@@ -355,6 +356,7 @@ Ref<ShortCut> BaseButton::get_shortcut() const {
}
void BaseButton::_unhandled_input(Ref<InputEvent> p_event) {
ERR_FAIL_COND(p_event.is_null());
if (!is_disabled() && is_visible_in_tree() && !p_event->is_echo() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) {