summaryrefslogtreecommitdiff
path: root/src/helpers/MiscFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
-rw-r--r--src/helpers/MiscFunctions.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 2a200f1e..71616ebf 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -173,10 +173,11 @@ SWorkspaceIDName getWorkspaceIDNameFromString(const std::string& in) {
}
}
} else if (in.starts_with("prev")) {
- if (!Desktop::focusState()->monitor())
+ auto monitor = Desktop::focusState()->monitor();
+ if (!monitor)
return {WORKSPACE_INVALID};
- const auto PWORKSPACE = Desktop::focusState()->monitor()->m_activeWorkspace;
+ const auto PWORKSPACE = monitor->m_activeWorkspace;
if (!valid(PWORKSPACE))
return {WORKSPACE_INVALID};