diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index c6cf2b4ccee..6d06a3a1718 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -105,8 +105,8 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for break; } } - } else - PMONITOR = g_pCompositor->getWorkspaceByID(pNode->workspaceID)->m_pMonitor.lock(); + } else if (const auto WS = g_pCompositor->getWorkspaceByID(pNode->workspaceID); WS) + PMONITOR = WS->m_pMonitor.lock(); if (!PMONITOR) { Debug::log(ERR, "Orphaned Node {}!!", pNode);