diff --git a/CHANGES b/CHANGES index 2e912e3a1..0e751c04c 100644 --- a/CHANGES +++ b/CHANGES @@ -77,6 +77,7 @@ Other fixes: - Qt: Fix cancelling pausing before the frame ends - Qt: Fix gamepad event dispatching (fixes mgba.io/i/1922) - Qt: Pre-attach GDB stub when launching with -g (fixes mgba.io/i/1950) + - Qt: Fix crash when editing shortcuts with none selected (fixes mgba.io/i/1964) - SM83: Simplify register pair access on big endian - SM83: Disassemble STOP as one byte - Wii: Fix crash on unloading irregularly sized GBA ROMs diff --git a/src/platform/qt/ShortcutView.cpp b/src/platform/qt/ShortcutView.cpp index 78b600906..cf0826006 100644 --- a/src/platform/qt/ShortcutView.cpp +++ b/src/platform/qt/ShortcutView.cpp @@ -87,7 +87,7 @@ void ShortcutView::clear() { QModelIndex index = m_ui.shortcutTable->selectionModel()->currentIndex(); QString name = m_model->name(index); const Shortcut* item = m_controller->shortcut(name); - if (!item->action()) { + if (!item || !item->action()) { return; } if (m_ui.gamepadButton->isChecked()) { @@ -106,7 +106,7 @@ void ShortcutView::updateButton(int button) { } QString name = m_model->name(m_ui.shortcutTable->selectionModel()->currentIndex()); const Shortcut* item = m_controller->shortcut(name); - if (!item->action()) { + if (!item || !item->action()) { return; } if (m_ui.gamepadButton->isChecked()) { @@ -122,7 +122,7 @@ void ShortcutView::updateAxis(int axis, int direction) { } QString name = m_model->name(m_ui.shortcutTable->selectionModel()->currentIndex()); const Shortcut* item = m_controller->shortcut(name); - if (!item->action()) { + if (!item || !item->action()) { return; } m_controller->updateAxis(name, axis, static_cast(direction));