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 --- editor/code_editor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'editor/code_editor.cpp') diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 11be365f0a..ac8bef817b 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -109,6 +109,8 @@ void FindReplaceBar::_notification(int p_what) { } void FindReplaceBar::_unhandled_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref k = p_event; if (!k.is_valid() || !k->is_pressed()) { return; @@ -691,6 +693,8 @@ FindReplaceBar::FindReplaceBar() { // This function should be used to handle shortcuts that could otherwise // be handled too late if they weren't handled here. void CodeTextEditor::_input(const Ref &event) { + ERR_FAIL_COND(event.is_null()); + const Ref key_event = event; if (!key_event.is_valid() || !key_event->is_pressed() || !text_editor->has_focus()) { return; -- cgit v1.2.3