Qt: Fix crash when mapping gamepad if no key is selected

This commit is contained in:
Jeffrey Pfau 2014-12-16 00:12:57 -08:00
parent fa1b74a89b
commit fcac245b98
1 changed files with 2 additions and 2 deletions

View File

@ -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<QPair<int, int32_t>> activeAxes = m_controller->activeGamepadAxes();
if (!activeAxes.empty()) {