From 725d4036a43898ddfaf033b507ffbdad7849efda Mon Sep 17 00:00:00 2001 From: Benjamin Klum Date: Sun, 27 Oct 2024 21:53:40 +0100 Subject: [PATCH] Fix panic when removing mapping while some mapping panel edit control has focus --- main/src/infrastructure/ui/mapping_panel.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/src/infrastructure/ui/mapping_panel.rs b/main/src/infrastructure/ui/mapping_panel.rs index 81701ed27..73629b617 100644 --- a/main/src/infrastructure/ui/mapping_panel.rs +++ b/main/src/infrastructure/ui/mapping_panel.rs @@ -7324,6 +7324,10 @@ impl View for MappingPanel { if self.is_invoked_programmatically() { return false; } + if self.session().try_borrow_mut().is_err() { + // This happens e.g. when the edit control had focus while removing the mapping. + return false; + } let view = self.clone(); self.handle_potential_min_max_edit_control_change(resource_id); // This is also called when the window is hidden.