From 1f46d4ee7e7af17012dc6a0f10a7bbfee135a815 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Tue, 12 Nov 2024 18:23:52 +0000 Subject: [PATCH] fix crash on despawned combobox popup --- crates/ui_core/src/combo_box.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui_core/src/combo_box.rs b/crates/ui_core/src/combo_box.rs index 4be33d51..7aae1d71 100644 --- a/crates/ui_core/src/combo_box.rs +++ b/crates/ui_core/src/combo_box.rs @@ -277,7 +277,9 @@ fn update_comboboxen( On::::new(close_ui_silent), On::::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;