fix: dont panic on cleanup

This commit is contained in:
Jonathan Kelley 2022-12-15 14:26:05 -08:00
parent fa3d1ef574
commit 8530db69e1

View file

@ -355,7 +355,11 @@ impl<'b> VirtualDom {
self.reclaim(id)
}
}
Placeholder(t) => self.reclaim(t.id.take().unwrap()),
Placeholder(t) => {
if let Some(id) = t.id.take() {
self.reclaim(id)
}
}
Fragment(nodes) => nodes.iter().for_each(|node| self.clean_up_node(node)),
};
}