summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp
index e626ff8a2a..f1842d7894 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp
@@ -67,8 +67,12 @@ DebugInfoWidget::DebugInfoWidget()
m_backtrace_view->on_selection_change = [this] {
const auto& index = m_backtrace_view->selection().first();
- auto& model = static_cast<BacktraceModel&>(*m_backtrace_view->model());
+ if (!index.is_valid()) {
+ return;
+ }
+
+ auto& model = static_cast<BacktraceModel&>(*m_backtrace_view->model());
// Note: The reconstruction of the register set here is obviously incomplete.
// We currently only reconstruct eip & ebp. Ideally would also reconstruct the other registers somehow.
// (Other registers may be needed to get the values of variables who are not stored on the stack)