diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs index 7ff8a59229fca..280b99b153667 100644 --- a/crates/bevy_ui/src/layout/mod.rs +++ b/crates/bevy_ui/src/layout/mod.rs @@ -129,7 +129,10 @@ without UI components as a child of an entity with UI components, results may be } } - let taffy_node = self.entity_to_taffy.get(&entity).unwrap(); + let Some(taffy_node) = self.entity_to_taffy.get(&entity) else { + warn!("Missing taffy node for entity when calling update_children."); + return; + }; self.taffy .set_children(*taffy_node, &taffy_children) .unwrap();