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()) {