Skip to content

Commit 50117b9

Browse files
committed
Fix panic in bevy_ui layout
1 parent 9790c02 commit 50117b9

File tree

1 file changed

+4
-1
lines changed
  • crates/bevy_ui/src/layout

1 file changed

+4
-1
lines changed

crates/bevy_ui/src/layout/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ without UI components as a child of an entity with UI components, results may be
129129
}
130130
}
131131

132-
let taffy_node = self.entity_to_taffy.get(&entity).unwrap();
132+
let Some(taffy_node) = self.entity_to_taffy.get(&entity) else {
133+
warn!("Missing taffy node for entity when calling update_children");
134+
return;
135+
};
133136
self.taffy
134137
.set_children(*taffy_node, &taffy_children)
135138
.unwrap();

0 commit comments

Comments
 (0)