fix(wm): avoid out of range subtraction

This fixes the panic, but not the underlying problem.

Updates #757
Updates #758
This commit is contained in:
James Tucker
2024-04-13 21:43:16 -07:00
parent b476bee1d8
commit efa562de5c

View File

@@ -1022,7 +1022,7 @@ impl Workspace {
.ok_or_else(|| anyhow!("there is no monocle container"))?;
let container = container.clone();
if restore_idx > self.containers().len() - 1 {
if restore_idx >= self.containers().len() {
self.containers_mut()
.resize(restore_idx, Container::default());
}