From 77fb9d415b2dde43dcd1142afaa6dc293734fc0e Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Sat, 21 Oct 2023 10:45:10 -0600 Subject: yuzu: Fix restore shortcuts button --- src/yuzu/configuration/configure_hotkeys.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/yuzu/configuration/configure_hotkeys.cpp') diff --git a/src/yuzu/configuration/configure_hotkeys.cpp b/src/yuzu/configuration/configure_hotkeys.cpp index 0b2a965f8..68e21cd84 100644 --- a/src/yuzu/configuration/configure_hotkeys.cpp +++ b/src/yuzu/configuration/configure_hotkeys.cpp @@ -319,6 +319,13 @@ void ConfigureHotkeys::ApplyConfiguration(HotkeyRegistry& registry) { void ConfigureHotkeys::RestoreDefaults() { for (int r = 0; r < model->rowCount(); ++r) { const QStandardItem* parent = model->item(r, 0); + const int hotkey_size = static_cast(Config::default_hotkeys.size()); + + if (hotkey_size != parent->rowCount()) { + QMessageBox::warning(this, tr("Invalid hotkey settings"), + tr("An error occurred. Please report this issue on github.")); + return; + } for (int r2 = 0; r2 < parent->rowCount(); ++r2) { model->item(r, 0) -- cgit v1.2.3