From c1fdb233107e2df01a6f164913cfefb3fe258eb7 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Mon, 16 Aug 2021 07:46:06 +0100 Subject: [PATCH] fix crash --- game/system/newpad.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/game/system/newpad.cpp b/game/system/newpad.cpp index e715adb882..58a912f22e 100644 --- a/game/system/newpad.cpp +++ b/game/system/newpad.cpp @@ -79,8 +79,12 @@ void OnKeyRelease(int key) { if (input_mode == InputModeStatus::Enabled) { return; } + + // if we come out of input mode, the key wont be found. + if (g_key_status.find(key) == g_key_status.end()) { + return; + } // set absolute key status - // no bounds checking for now in order to catch bugs g_key_status.at(key) = 0; }