summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2022-07-02 09:18:28 +0200
committerGitHub <noreply@github.com>2022-07-02 09:18:28 +0200
commit2a791116f1c6254a9ebb05279d0c3efe585dda95 (patch)
tree20ac3dcfe8fe56d0c919ace72479af8a95c63d21 /Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
parent07a15a3228cb141e98fdfb51c09786f10e77389b (diff)
parentbf682118785621d9510cdf848e7eb3533a516674 (diff)
Merge pull request #10800 from Pokechu22/registerwidget-crash
RegisterWidget: Fix crash when right-clicking when there is no selected cell
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/RegisterWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/RegisterWidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
index 0d53155519..8ce8d19ca4 100644
--- a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
@@ -114,11 +114,11 @@ void RegisterWidget::ShowContextMenu()
{
QMenu* menu = new QMenu(this);
- auto variant = m_table->currentItem()->data(DATA_TYPE);
+ auto* raw_item = m_table->currentItem();
- if (!variant.isNull())
+ if (raw_item != nullptr && !raw_item->data(DATA_TYPE).isNull())
{
- auto* item = static_cast<RegisterColumn*>(m_table->currentItem());
+ auto* item = static_cast<RegisterColumn*>(raw_item);
auto type = static_cast<RegisterType>(item->data(DATA_TYPE).toInt());
auto display = item->GetDisplay();