diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-09-23 15:55:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-23 15:55:57 +0200 |
commit | 215fa6e85b8a22e75081190293460f720291f6a5 (patch) | |
tree | 316317cd332d739d69f8b1bc5719074749eebb95 | |
parent | 7b1de6deda76d8998623ef78ef6e96ecf00c9acd (diff) | |
parent | f4e34ac353b736708934abc3bf697fc45e53bbbb (diff) |
Merge pull request #42274 from KoBeWi/nullevents
Check for null in InputMap::_find_event
-rw-r--r-- | core/input/input_map.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<StringName> InputMap::get_actions() const { } List<Ref<InputEvent>>::Element *InputMap::_find_event(Action &p_action, const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength) const { + ERR_FAIL_COND_V(!p_event.is_valid(), nullptr); + for (List<Ref<InputEvent>>::Element *E = p_action.inputs.front(); E; E = E->next()) { const Ref<InputEvent> e = E->get(); |