summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorOatmealDome <OatmealDome@users.noreply.github.com>2026-03-15 20:13:41 -0400
committerGitHub <noreply@github.com>2026-03-15 20:13:41 -0400
commit4dc5ead17290f0c6dbc28ec032f922b61644e3fd (patch)
tree780860681835f65410a5645bbacafc29ea757caf /Source/Core
parentd60942d3cb4be0a11743b1d3e6b42356ab986385 (diff)
parentaba842c09af4956a1e45ea3fa84145010d130150 (diff)
Merge pull request #14469 from OatmealDome/backend-warning
GeneralWidget: Add protections against invalid values in BackendWarning()
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp
index f2004ff2c4..9ade7dfe0e 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp
@@ -173,8 +173,20 @@ void GeneralWidget::BackendWarning()
{
if (Config::GetActiveLayerForConfig(Config::MAIN_GFX_BACKEND) == Config::LayerType::Base)
{
- auto warningMessage = VideoBackendBase::GetAvailableBackends()[m_backend_combo->currentIndex()]
- ->GetWarningMessage();
+ const auto& backends = VideoBackendBase::GetAvailableBackends();
+ if (backends.empty())
+ {
+ return;
+ }
+
+ const int current_idx = m_backend_combo->currentIndex();
+ if (current_idx == -1)
+ {
+ // Don't attempt to get the current backend if it doesn't match any available backends.
+ return;
+ }
+
+ auto warningMessage = backends[current_idx]->GetWarningMessage();
if (warningMessage)
{
ModalMessageBox confirm_sw(this);