mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix crash when mapping gamepad if no key is selected
This commit is contained in:
parent
fa1b74a89b
commit
fcac245b98
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue