diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index fcd8c900..f1e6b858 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -199,7 +199,11 @@ void CHyprMasterLayout::onWindowRemovedTiling(CWindow* pWindow) { } void CHyprMasterLayout::recalculateMonitor(const int& monid) { - const auto PMONITOR = g_pCompositor->getMonitorFromID(monid); + const auto PMONITOR = g_pCompositor->getMonitorFromID(monid); + + if (!PMONITOR) + return; + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace); if (!PWORKSPACE)