Explorar o código

fix: dont panc

Jonathan Kelley %!s(int64=2) %!d(string=hai) anos
pai
achega
c90be6bdc5
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      packages/core/src/arena.rs

+ 5 - 1
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))
             }