Skip to content

Commit

Permalink
master: Add more null checks for rollnext (#4343)
Browse files Browse the repository at this point in the history
* add more null check for rollnext

* remove pwindow check
  • Loading branch information
thejch committed Jan 4, 2024
1 parent 4d6d662 commit 880996b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/layout/MasterLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,10 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (!PNODE)
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);

for (auto& nd : m_lMasterNodesData) {
Expand All @@ -1359,7 +1362,10 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (!PNODE)
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);

for (auto& nd : m_lMasterNodesData | std::views::reverse) {
Expand Down

0 comments on commit 880996b

Please sign in to comment.