mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
Avoid unconditionally unwrapping the Result - UI Stack System (#11575)
# Objective - Fixes #11572 ## Solution - Avoid unconditionally unwrapping the `Result` in the `ui_stack_system` function.
This commit is contained in:
parent
b0f5d4df58
commit
fb124c35be
1 changed files with 3 additions and 5 deletions
|
@ -58,11 +58,9 @@ pub fn ui_stack_system(
|
|||
fill_stack_recursively(&mut ui_stack.uinodes, &mut global_context);
|
||||
|
||||
for (i, entity) in ui_stack.uinodes.iter().enumerate() {
|
||||
update_query
|
||||
.get_mut(*entity)
|
||||
.unwrap()
|
||||
.bypass_change_detection()
|
||||
.stack_index = i as u32;
|
||||
if let Ok(mut node) = update_query.get_mut(*entity) {
|
||||
node.bypass_change_detection().stack_index = i as u32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue