From 14cfe37c8b3a65d794f78071de94124d82870494 Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Mon, 16 Jun 2025 12:15:42 +0100 Subject: [PATCH] Debugger: Fix crash when breakpoint is hit before createMenuBar call --- pcsx2-qt/Debugger/Docking/DockManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcsx2-qt/Debugger/Docking/DockManager.cpp b/pcsx2-qt/Debugger/Docking/DockManager.cpp index 820b3c8243..e1e34ebd6d 100644 --- a/pcsx2-qt/Debugger/Docking/DockManager.cpp +++ b/pcsx2-qt/Debugger/Docking/DockManager.cpp @@ -142,12 +142,12 @@ void DockManager::switchToLayout(DockLayout::Index layout_index, bool blink_tab) layout.thaw(); int tab_index = static_cast(layout_index); - if (m_menu_bar && tab_index >= 0) + if (tab_index >= 0 && m_menu_bar) m_menu_bar->onCurrentLayoutChanged(layout_index); } } - if (blink_tab) + if (blink_tab && m_menu_bar) m_menu_bar->startBlink(m_current_layout); } @@ -512,7 +512,8 @@ void DockManager::newLayoutClicked() { // The plus button has just been made the current tab, so set it back to the // one corresponding to the current layout again. - m_menu_bar->onCurrentLayoutChanged(m_current_layout); + if (m_menu_bar) + m_menu_bar->onCurrentLayoutChanged(m_current_layout); auto name_validator = [this](const QString& name) { return !hasNameConflict(name, DockLayout::INVALID_INDEX);