From 2130cef3a9448d9e9ff514c20528a35cdc7c91a1 Mon Sep 17 00:00:00 2001 From: Seraphima Zykova Date: Thu, 23 Sep 2021 18:24:24 +0300 Subject: [PATCH] [FancyZones Editor] Fix crash on closing after deleting a custom layout. (#13394) --- .../fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs index 19f55207a9..acbb1fd650 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs @@ -419,6 +419,11 @@ namespace FancyZonesEditor { LayoutModel model = element.DataContext as LayoutModel; + if (model.Guid == _backup.Guid) + { + _backup = null; + } + if (model == _settings.AppliedModel) { _settings.SetAppliedModel(_settings.BlankModel);