From b0f95c63c9d7fa1b67e5f7aa5915d2e9d3b89904 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 22 Nov 2022 23:17:10 +0000 Subject: [PATCH] fix crash in setActiveMonitor null --- src/Compositor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index f698f05a..f0c51dc5 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1992,6 +1992,11 @@ void CCompositor::setActiveMonitor(CMonitor* pMonitor) { if (m_pLastMonitor == pMonitor) return; + if (!pMonitor) { + m_pLastMonitor = nullptr; + return; + } + const auto PWORKSPACE = getWorkspaceByID(pMonitor->activeWorkspace); g_pEventManager->postEvent(SHyprIPCEvent{"focusedmon", pMonitor->szName + "," + PWORKSPACE->m_szName});