From 97b515edb7529b9567bef2a1d7bd31f4ae9222ea Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 30 Jun 2022 16:00:44 +0200 Subject: [PATCH] fix crash --- src/Compositor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index d0107f57..20a4add4 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -680,10 +680,16 @@ CWorkspace* CCompositor::getWorkspaceByID(const int& id) { void CCompositor::sanityCheckWorkspaces() { for (auto it = m_vWorkspaces.begin(); it != m_vWorkspaces.end(); ++it) { + if (!it->get()) + return; // why does this occur when switching from an empty workspace to an open one? + if ((getWindowsOnWorkspace((*it)->m_iID) == 0 && !isWorkspaceVisible((*it)->m_iID))) { it = m_vWorkspaces.erase(it); } + if (it == m_vWorkspaces.end()) + continue; + if ((*it)->m_iID == SPECIAL_WORKSPACE_ID && getWindowsOnWorkspace((*it)->m_iID) == 0) { for (auto& m : m_vMonitors) { m->specialWorkspaceOpen = false;