Skip to content

Commit

Permalink
fix crash on despawned combobox popup
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Nov 12, 2024
1 parent 815dbdc commit 1f46d4e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/ui_core/src/combo_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ fn update_comboboxen(
On::<Defocus>::new(close_ui_silent),
On::<Click>::new(move |mut commands: Commands| {
debug!("selected {ix:?}");
commands.entity(popup.root).despawn_recursive();
if let Some(commands) = commands.get_entity(popup.root) {
commands.despawn_recursive();
}
let Some(mut commands) = commands.get_entity(ent) else {
warn!("no combo");
return;
Expand Down

0 comments on commit 1f46d4e

Please sign in to comment.