From 45107f5afbc4f306b72d0645f203d9a68e9b0d56 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Thu, 1 Feb 2018 15:58:51 +0100 Subject: [PATCH] Fix segfault on pressing Command+q in main menu. --- rwgame/RWGame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rwgame/RWGame.cpp b/rwgame/RWGame.cpp index 3ad9d4d4..30775943 100644 --- a/rwgame/RWGame.cpp +++ b/rwgame/RWGame.cpp @@ -867,7 +867,7 @@ void RWGame::globalKeyEvent(const SDL_Event& event) { } std::string keyName = SDL_GetKeyName(event.key.keysym.sym); - if (keyName.length() == 1) { + if (getPlayer() && keyName.length() == 1) { char symbol = keyName[0]; handleCheatInput(symbol); }