diff --git a/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs b/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs index ca93e54e..1c1be94c 100644 --- a/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs +++ b/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs @@ -45,9 +45,14 @@ namespace HavenSoft.HexManiac.WPF.Implementations { try { Clipboard.SetDataObject(value, true); } catch (COMException) { - // something went wrong... we couldn't copy - var window = (MainWindow)Application.Current.MainWindow; - window.ViewModel.ErrorMessage = "Could not copy"; + try { + // try again, but don't try to persist the value after app exit + Clipboard.SetDataObject(value); + } catch (COMException) { + // something went wrong... we couldn't copy + var window = (MainWindow)Application.Current.MainWindow; + window.ViewModel.ErrorMessage = "Could not copy"; + } } } }