diff options
| author | thejch <66577496+thejch@users.noreply.github.com> | 2024-01-04 07:17:17 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-04 16:17:17 +0100 |
| commit | 880996b05339ba87066958a517885f1941185269 (patch) | |
| tree | e3a968ca5a4ed5603faa2044b881dc07ca2b971f /src/layout/MasterLayout.cpp | |
| parent | 4d6d662c67786c86647cf41b5b20d9c0b418dbb3 (diff) | |
master: Add more null checks for rollnext (#4343)
* add more null check for rollnext
* remove pwindow check
Diffstat (limited to 'src/layout/MasterLayout.cpp')
| -rw-r--r-- | src/layout/MasterLayout.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 2506bbf2..9a76801c 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -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) { @@ -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) { |
