Browse Source

Check for null in InputMap::_find_event

(cherry picked from commit f4e34ac353b736708934abc3bf697fc45e53bbbb)
Tomasz Chabora 4 years ago
parent
commit
13d7404cd7
1 changed files with 1 additions and 0 deletions
  1. 1 0
      core/input_map.cpp

+ 1 - 0
core/input_map.cpp

@@ -100,6 +100,7 @@ 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(), NULL);
 
 	for (List<Ref<InputEvent> >::Element *E = p_action.inputs.front(); E; E = E->next()) {