From d2c8bf7f5e8f086cdbbbde7d5655d6165aa88d50 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sun, 17 May 2026 23:47:09 +0000 Subject: [PATCH] [qt] fix crash when switching between builds that add new filters Signed-off-by: lizzie --- src/yuzu/configuration/shared_widget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index ce11763f91..cda4e6cd37 100644 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp @@ -160,6 +160,10 @@ QWidget* Widget::CreateCombobox(std::function& serializer, serializer = [this, enumeration]() { int current = combobox->currentIndex(); + if (current > int(enumeration->size())) { + LOG_WARNING(Frontend, "Invalid enum {}", current); + current = 0; + } return std::to_string(enumeration->at(current).first); }; @@ -169,10 +173,8 @@ QWidget* Widget::CreateCombobox(std::function& serializer, }; if (!Settings::IsConfiguringGlobal()) { - combobox->connect(combobox, QOverload::of(&QComboBox::activated), - [touch]() { touch(); }); + combobox->connect(combobox, QOverload::of(&QComboBox::activated), [touch]() { touch(); }); } - return combobox; }