From 1512b81126dd115f089fd21244692d92034c78f8 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Tue, 2 Jan 2024 22:18:30 +0100 Subject: [PATCH] master: guard PNODE in roll* fixes #4331 --- src/layout/MasterLayout.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 63389c3a..2506bbf2 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -1331,6 +1331,9 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri const auto PWINDOW = header.pWindow; const auto PNODE = getNodeFromWindow(PWINDOW); + if (!PNODE) + return 0; + const auto OLDMASTER = PNODE->isMaster ? PNODE : getMasterNodeOnWorkspace(PNODE->workspaceID); const auto OLDMASTERIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *OLDMASTER); @@ -1353,6 +1356,9 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri const auto PWINDOW = header.pWindow; const auto PNODE = getNodeFromWindow(PWINDOW); + if (!PNODE) + return 0; + const auto OLDMASTER = PNODE->isMaster ? PNODE : getMasterNodeOnWorkspace(PNODE->workspaceID); const auto OLDMASTERIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *OLDMASTER);