From c970a6870f24b13b8dbc0710f4aaf6bf30e84cb3 Mon Sep 17 00:00:00 2001 From: Mgamerz Date: Fri, 6 Nov 2020 23:30:07 -0700 Subject: [PATCH] Fix crash from telemetry: Clicking the options button too fast would cause crash --- ALOTInstallerWPF/MainWindow.xaml.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ALOTInstallerWPF/MainWindow.xaml.cs b/ALOTInstallerWPF/MainWindow.xaml.cs index 673e4d65..53ce419f 100644 --- a/ALOTInstallerWPF/MainWindow.xaml.cs +++ b/ALOTInstallerWPF/MainWindow.xaml.cs @@ -94,7 +94,15 @@ public Task GetFlyoutResponse(string topText, params Button[] buttons) var content = new FlyoutDialogPanel(topText, buttons, selectedOption => { - tcs.SetResult(selectedOption); + // If user clicks too fast this can cause an exception. + try + { + tcs.SetResult(selectedOption); + } + catch + { + } + BottomBasicDialog.IsOpen = false; }); BottomBasicDialog.Content = null; //clear