diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 479b5378..cca74a58 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2616,7 +2616,7 @@ void CCompositor::setActiveMonitor(CMonitor* pMonitor) { const auto PWORKSPACE = getWorkspaceByID(pMonitor->activeWorkspace); - g_pEventManager->postEvent(SHyprIPCEvent{"focusedmon", pMonitor->szName + "," + PWORKSPACE->m_szName}); + g_pEventManager->postEvent(SHyprIPCEvent{"focusedmon", pMonitor->szName + "," + (PWORKSPACE ? PWORKSPACE->m_szName : "?")}); EMIT_HOOK_EVENT("focusedMon", pMonitor); m_pLastMonitor = pMonitor; }