mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix crash when editing shortcuts with none selected (fixes #1964)
This commit is contained in:
parent
542404b7fa
commit
e31de6b470
1
CHANGES
1
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
|
||||
|
|
|
@ -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<GamepadAxisEvent::Direction>(direction));
|
||||
|
|
Loading…
Reference in New Issue