bevy/crates
Nicola Papale 9073d446dc
Do not panic on non-UI child of UI entity (#9621)
Legitimately, bevy emits a WARN when encountering entities in UI trees
without NodeBunlde components.

Bevy pretty much always panics when such a thing happens, due to the
update_clipping system.

However, sometimes, it's perfectly legitimate to have a child without UI
nodes in a UI tree. For example, as a "seed" entity that is consumed by
a 3rd party plugin, which will later spawn a valid UI tree. In loading
scenarios, you are pretty much guaranteed to have incomplete children.

The presence of the WARN hints that bevy does not intend to panic on
such occasion (otherwise the warn! would be a panic!) so I assume panic
is an unintended behavior, aka a bug.

## Solution

Early-return instead of panicking.

I did only test that it indeed fixed the panic, not checked for UI
inconsistencies. Though on a logical level, it can only have changed
code that would otherwise panic.

## Alternatives

Instead of early-returning on invalid entity in `update_clipping`, do
not call it with invalid entity in its recursive call.

---

## Changelog

- Do not panic on non-UI child of UI entity
2023-08-29 10:49:40 +00:00
..
bevy_a11y Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_animation check root node for animations (#9407) 2023-08-28 17:06:12 +00:00
bevy_app Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_asset Fix panic when using .load_folder() with absolute paths (#9490) 2023-08-28 17:23:44 +00:00
bevy_audio Clarify what happens when setting the audio volume (#9480) 2023-08-28 18:21:12 +00:00
bevy_core Remove Resource and add Debug to TaskPoolOptions (#9485) 2023-08-20 22:32:41 +00:00
bevy_core_pipeline Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_derive bevy_derive: Fix #[deref] breaking other attributes (#9551) 2023-08-28 17:36:18 +00:00
bevy_diagnostic Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_dylib Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_dynamic_plugin Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_ecs Allow disjoint mutable world access via EntityMut (#9419) 2023-08-28 23:30:59 +00:00
bevy_ecs_compile_fail_tests Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
bevy_encase_derive Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_gilrs input: allow multiple gamepad inputs to be registered for one button in one frame (#9446) 2023-08-15 21:50:29 +00:00
bevy_gizmos Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_gltf only take up to the max number of joints (#9351) 2023-08-28 16:58:45 +00:00
bevy_hierarchy Allow disjoint mutable world access via EntityMut (#9419) 2023-08-28 23:30:59 +00:00
bevy_input Bevy Input Docs : the modules (#9467) 2023-08-23 12:44:49 +00:00
bevy_internal fix clippy::default_constructed_unit_structs and trybuild errors (#9144) 2023-07-13 22:23:04 +00:00
bevy_log Update tracy-client requirement from 0.15 to 0.16 (#9436) 2023-08-15 07:45:21 +00:00
bevy_macro_utils Add some more helpful errors to BevyManifest when it doesn't find Cargo.toml (#9207) 2023-07-19 12:05:04 +00:00
bevy_macros_compile_fail_tests bevy_derive: Fix #[deref] breaking other attributes (#9551) 2023-08-28 17:36:18 +00:00
bevy_math Rename Bezier to CubicBezier for clarity (#9554) 2023-08-28 17:37:42 +00:00
bevy_mikktspace Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_pbr only take up to the max number of joints (#9351) 2023-08-28 16:58:45 +00:00
bevy_ptr Put #[repr(transparent)] attr to bevy_ptr types (#9068) 2023-07-14 18:55:15 +00:00
bevy_reflect Make the reflect path parser utf-8-unaware (#9371) 2023-08-25 23:12:25 +00:00
bevy_reflect_compile_fail_tests Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
bevy_render Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_scene Replaced EntityMap with HashMap (#9461) 2023-08-28 17:18:16 +00:00
bevy_sprite Improve documentation relating to Frustum and HalfSpace (#9136) 2023-08-28 16:47:25 +00:00
bevy_tasks elaborate on TaskPool and bevy tasks (#8750) 2023-08-11 21:07:28 +00:00
bevy_text Cleanup some bevy_text pipeline.rs (#9111) 2023-08-28 16:46:16 +00:00
bevy_time Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_transform Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_ui Do not panic on non-UI child of UI entity (#9621) 2023-08-29 10:49:40 +00:00
bevy_utils Add system.map(...) for transforming the output of a system (#8526) 2023-08-28 16:36:46 +00:00
bevy_window Check cursor position for out of bounds of the window (#8855) 2023-08-28 16:37:44 +00:00
bevy_winit Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00