From c9e64acad2860e1068cf11468da00acc7ee2f86d Mon Sep 17 00:00:00 2001 From: 19MisterX98 Date: Sun, 17 Aug 2025 02:00:44 +0200 Subject: [PATCH] fix: don't assume previous workspace still exists #1588 --- src/shell/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shell/mod.rs b/src/shell/mod.rs index da965082..83dd1d23 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -1144,8 +1144,9 @@ impl Workspaces { .or(self.backup_set.as_ref()) .map(|set| { ( - set.previously_active - .map(|(idx, start)| (&set.workspaces[idx], start)), + set.previously_active.and_then(|(idx, start)| { + set.workspaces.get(idx).map(|previous| (previous, start)) + }), &set.workspaces[set.active], ) })