fix: don't assume previous workspace still exists #1588

This commit is contained in:
19MisterX98 2025-08-17 02:00:44 +02:00 committed by Victoria Brekenfeld
parent 3f74a22cca
commit c9e64acad2

View file

@ -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],
)
})