From fcac245b989875ea59342c2f71bd06135329576f Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 16 Dec 2014 00:12:57 -0800 Subject: [PATCH] Qt: Fix crash when mapping gamepad if no key is selected --- src/platform/qt/GBAKeyEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/qt/GBAKeyEditor.cpp b/src/platform/qt/GBAKeyEditor.cpp index a0cfa0098..648aa76c6 100644 --- a/src/platform/qt/GBAKeyEditor.cpp +++ b/src/platform/qt/GBAKeyEditor.cpp @@ -217,11 +217,11 @@ void GBAKeyEditor::bindKey(const KeyEditor* keyEditor, GBAKey key) { #ifdef BUILD_SDL void GBAKeyEditor::testGamepad() { - KeyEditor* focused = *m_currentKey; - if (!focused) { + if (m_currentKey == m_keyOrder.end() || !*m_currentKey) { QTimer::singleShot(50, this, SLOT(testGamepad())); return; } + KeyEditor* focused = *m_currentKey; QSet> activeAxes = m_controller->activeGamepadAxes(); if (!activeAxes.empty()) {