diff --git a/CHANGELOG.md b/CHANGELOG.md index f137bc3..dd0f3c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- Fixed a panic that could occur when removing some deeply nested hierarchies + from a window. + ### Added - `AnimationRecorder::animate_keypress` is a new helper that animates a single diff --git a/src/tree.rs b/src/tree.rs index 9de8bb0..dde860a 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -506,7 +506,7 @@ impl TreeData { removed_node .children .into_iter() - .map(|id| self.nodes[id].widget.id()), + .filter_map(|id| self.nodes.get(id).map(|node| node.widget.id())), ); if let Some(next_focus) = removed_node.widget.next_focus() {