From 55d9df379a357eee1dee48f09c9571a187b2363d Mon Sep 17 00:00:00 2001 From: spycrab Date: Thu, 29 Mar 2018 21:22:16 +0200 Subject: [PATCH] Qt/PatchesWidget: Fix segfault --- Source/Core/DolphinQt2/Config/PatchesWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt2/Config/PatchesWidget.cpp b/Source/Core/DolphinQt2/Config/PatchesWidget.cpp index b0af60eb36..99a99d0901 100644 --- a/Source/Core/DolphinQt2/Config/PatchesWidget.cpp +++ b/Source/Core/DolphinQt2/Config/PatchesWidget.cpp @@ -169,7 +169,8 @@ void PatchesWidget::Update() void PatchesWidget::UpdateActions() { bool selected = !m_list->selectedItems().isEmpty(); - auto* item = m_list->selectedItems()[0]; + + auto* item = selected ? m_list->selectedItems()[0] : nullptr; bool user_defined = selected ? item->data(Qt::UserRole).toBool() : true;