diff --git a/src/Compositor.cpp b/src/Compositor.cpp index cb94116db..8a3a8cbfe 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2154,11 +2154,13 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, PHLMONITOR pMo Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with new {}", nextWorkspaceOnMonitorID); - g_pCompositor->createNewWorkspace(nextWorkspaceOnMonitorID, POLDMON->ID); + if (POLDMON) + g_pCompositor->createNewWorkspace(nextWorkspaceOnMonitorID, POLDMON->ID); } Debug::log(LOG, "moveWorkspaceToMonitor: Plugging gap with existing {}", nextWorkspaceOnMonitorID); - POLDMON->changeWorkspace(nextWorkspaceOnMonitorID, false, true, true); + if (POLDMON) + POLDMON->changeWorkspace(nextWorkspaceOnMonitorID, false, true, true); } // move the workspace