Qt: Fix crash when mapping gamepad if no key is selected
Jeffrey Pfau jeffrey@endrift.com
Tue, 16 Dec 2014 00:12:57 -0800
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/platform/qt/GBAKeyEditor.cpp
→
src/platform/qt/GBAKeyEditor.cpp
@@ -217,11 +217,11 @@ }
#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<QPair<int, int32_t>> activeAxes = m_controller->activeGamepadAxes(); if (!activeAxes.empty()) {