From c90be6bdc58a2dfb9a3be71646e2156a5b169b6f Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 14 Dec 2022 08:51:28 -0800 Subject: [PATCH] fix: dont panc --- packages/core/src/arena.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/arena.rs b/packages/core/src/arena.rs index 98960fca7..c39e10b5a 100644 --- a/packages/core/src/arena.rs +++ b/packages/core/src/arena.rs @@ -95,7 +95,11 @@ impl VirtualDom { fn drop_scope_inner(&mut self, node: &VNode) { node.clear_listeners(); node.dynamic_nodes.iter().for_each(|node| match node { - DynamicNode::Component(c) => self.drop_scope(c.scope.get().unwrap()), + DynamicNode::Component(c) => { + if let Some(f) = c.scope.get() { + self.drop_scope(f) + } + } DynamicNode::Fragment(nodes) => { nodes.iter().for_each(|node| self.drop_scope_inner(node)) }