From 504bc5cc6719db3bcafa5f1262b95fa2a58ec0a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 5 Apr 2021 08:52:21 +0200 Subject: Fix crashes in *_input functions --- scene/gui/base_button.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scene/gui/base_button.cpp') diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index db13b9b11f..826fd0189b 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -53,6 +53,8 @@ void BaseButton::_unpress_group() { } void BaseButton::_gui_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); + if (status.disabled) { // no interaction with disabled button return; } @@ -323,6 +325,8 @@ Ref BaseButton::get_shortcut() const { } void BaseButton::_unhandled_key_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); + if (!_is_focus_owner_in_shorcut_context()) { return; } -- cgit v1.2.3