summaryrefslogtreecommitdiff
path: root/core/input/input_map.cpp
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2020-09-23 15:39:06 +0200
committerTomasz Chabora <kobewi4e@gmail.com>2020-09-23 15:39:06 +0200
commitf4e34ac353b736708934abc3bf697fc45e53bbbb (patch)
tree98c53cf64fdb99504fad8ff7ecdd5ffa9406e615 /core/input/input_map.cpp
parent9a463cb1d62a174aa34f608c0281963cdad255e9 (diff)
Check for null in InputMap::_find_event
Diffstat (limited to 'core/input/input_map.cpp')
-rw-r--r--core/input/input_map.cpp2
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();