Skip to content
Snippets Groups Projects
Unverified Commit 8cbde955 authored by John's avatar John Committed by GitHub
Browse files

Merge pull request #153 from StarArawn/fix-empty-errors

Fixed some errors when no nodes were present in the tree.
parents 808ac72e 276685b9
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ fn startup(
<TextWidgetBundle
text={TextProps {
content: "Hello World".into(),
size: 20.0,
..Default::default()
}}
/>
......
......@@ -387,7 +387,9 @@ fn update_widgets_sys(world: &mut World) {
let current = focus_tree.current();
focus_tree.clear();
if let Ok(tree) = context.tree.read() {
focus_tree.add(tree.root_node.unwrap(), &tree);
if let Some(root_node) = tree.root_node {
focus_tree.add(root_node, &tree);
}
}
current
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment