keybinds: check for null last monitor in changeworkspace (#4077)

This commit is contained in:
ddmetz 2023-12-06 17:09:25 -07:00 committed by GitHub
parent 4a42344e97
commit 62a8d0be5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -801,6 +801,10 @@ void CKeybindManager::changeworkspace(std::string args) {
static auto* const PWORKSPACECENTERON = &g_pConfigManager->getConfigValuePtr("binds:workspace_center_on")->intValue;
const auto PMONITOR = g_pCompositor->m_pLastMonitor;
if (!PMONITOR)
return;
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
const bool EXPLICITPREVIOUS = args.starts_with("previous");