aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJef <[email protected]>2022-11-15 11:18:04 +0100
committerGitHub <[email protected]>2022-11-15 10:18:04 +0000
commit4034aa2c60d7ed88cb64e7c36f42ec388c28cfb2 (patch)
tree002a4cf9b4488babd851d3215cf82e0ee848d4fb
parentfcb5037a1d22d05d9f58b8a43d75b1870d93b896 (diff)
downloadHyprland-4034aa2c60d7ed88cb64e7c36f42ec388c28cfb2.tar.gz
Hyprland-4034aa2c60d7ed88cb64e7c36f42ec388c28cfb2.zip
possible crash when current workspace does not exist (#1023)
Co-authored-by: Jef Steelant <[email protected]>
-rw-r--r--src/managers/KeybindManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 9bd52ae8..a2f76d69 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -680,7 +680,7 @@ void CKeybindManager::changeworkspace(std::string args) {
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue;
- if (*PBACKANDFORTH && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) {
+ if (*PBACKANDFORTH && PCURRENTWORKSPACE && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) {
const auto PPREVWORKSPACE = g_pCompositor->getWorkspaceByID(PCURRENTWORKSPACE->m_iPrevWorkspaceID);
@@ -699,7 +699,7 @@ void CKeybindManager::changeworkspace(std::string args) {
if (!*PALLOWWORKSPACECYCLES)
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
- } else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal)
+ } else if (PCURRENTWORKSPACE && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal)
return;
// remove constraints