Skip to content

Commit

Permalink
RegisterWidget: Fix crash when right-clicking when there is no select…
Browse files Browse the repository at this point in the history
…ed cell
  • Loading branch information
Pokechu22 committed Jul 2, 2022
1 parent a12b9ba commit bf68211
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit bf68211

Please sign in to comment.