From f4e34ac353b736708934abc3bf697fc45e53bbbb Mon Sep 17 00:00:00 2001 From: Tomasz Chabora Date: Wed, 23 Sep 2020 15:39:06 +0200 Subject: Check for null in InputMap::_find_event --- core/input/input_map.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index ac032b7d10..2bf8792421 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -95,6 +95,8 @@ List InputMap::get_actions() const { } List>::Element *InputMap::_find_event(Action &p_action, const Ref &p_event, bool *p_pressed, float *p_strength) const { + ERR_FAIL_COND_V(!p_event.is_valid(), nullptr); + for (List>::Element *E = p_action.inputs.front(); E; E = E->next()) { const Ref e = E->get(); -- cgit v1.2.3