summaryrefslogtreecommitdiffstats
path: root/src/osd/modules/debugger/qt/dasmwindow.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-05-11 14:19:52 -0400
committer AJR <ajrhacker@users.noreply.github.com>2021-05-11 14:19:52 -0400
commita1c914bef9304153cc2f00cae5dcbd69a2323969 (patch)
tree644f07f4569777696c79c2dae238f307696361b4 /src/osd/modules/debugger/qt/dasmwindow.cpp
parent3955b5c9e9a9ba6b15e601f471df75aba5dff79c (diff)
Fix crashes in Qt debugger caused by trying to select a nonexistent disassembly or memory view
Diffstat (limited to 'src/osd/modules/debugger/qt/dasmwindow.cpp')
-rw-r--r--src/osd/modules/debugger/qt/dasmwindow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp
index 4eee8d86fb1..44ce8bac988 100644
--- a/src/osd/modules/debugger/qt/dasmwindow.cpp
+++ b/src/osd/modules/debugger/qt/dasmwindow.cpp
@@ -119,8 +119,11 @@ DasmWindow::~DasmWindow()
void DasmWindow::cpuChanged(int index)
{
- m_dasmView->view()->set_source(*m_dasmView->view()->source(index));
- m_dasmView->viewport()->update();
+ if (index < m_dasmView->view()->source_count())
+ {
+ m_dasmView->view()->set_source(*m_dasmView->view()->source(index));
+ m_dasmView->viewport()->update();
+ }
}