master: Add more null checks for rollnext (#4343)

* add more null check for rollnext

* remove pwindow check
This commit is contained in:
thejch 2024-01-04 07:17:17 -08:00 committed by GitHub
parent 4d6d662c67
commit 880996b053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1334,7 +1334,10 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (!PNODE) if (!PNODE)
return 0; return 0;
const auto OLDMASTER = PNODE->isMaster ? PNODE : getMasterNodeOnWorkspace(PNODE->workspaceID); const auto OLDMASTER = PNODE->isMaster ? PNODE : getMasterNodeOnWorkspace(PNODE->workspaceID);
if (!OLDMASTER)
return 0;
const auto OLDMASTERIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *OLDMASTER); const auto OLDMASTERIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *OLDMASTER);
for (auto& nd : m_lMasterNodesData) { for (auto& nd : m_lMasterNodesData) {
@ -1359,7 +1362,10 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (!PNODE) if (!PNODE)
return 0; return 0;
const auto OLDMASTER = PNODE->isMaster ? PNODE : getMasterNodeOnWorkspace(PNODE->workspaceID); const auto OLDMASTER = PNODE->isMaster ? PNODE : getMasterNodeOnWorkspace(PNODE->workspaceID);
if (!OLDMASTER)
return 0;
const auto OLDMASTERIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *OLDMASTER); const auto OLDMASTERIT = std::find(m_lMasterNodesData.begin(), m_lMasterNodesData.end(), *OLDMASTER);
for (auto& nd : m_lMasterNodesData | std::views::reverse) { for (auto& nd : m_lMasterNodesData | std::views::reverse) {