From 44386678eb7b3f69ee78a04fc297c2b972298943 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Fri, 6 Dec 2024 10:32:15 +0900 Subject: [PATCH] fix: remove shell maybe cause panic --- iced_layershell/src/multi_window.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iced_layershell/src/multi_window.rs b/iced_layershell/src/multi_window.rs index 19fa180..739d062 100644 --- a/iced_layershell/src/multi_window.rs +++ b/iced_layershell/src/multi_window.rs @@ -1031,7 +1031,11 @@ pub(crate) fn run_action( } let option_id = if let LayershellCustomActionsWithInfo::RemoveWindow(id) = action.1 { - window_manager.get_layer_id(id) + let option_id = window_manager.get_layer_id(id); + if option_id.is_none() { + return; + } + option_id } else { None };