diff --git a/DesktopEdge/MainMenu.xaml.cs b/DesktopEdge/MainMenu.xaml.cs index af8ed378..33027f19 100644 --- a/DesktopEdge/MainMenu.xaml.cs +++ b/DesktopEdge/MainMenu.xaml.cs @@ -300,13 +300,20 @@ namespace ZitiDesktopEdge var closeMethod = mailWriter.GetType().GetMethod("Close", BindingFlags.Instance | BindingFlags.NonPublic); closeMethod.Invoke(mailWriter, BindingFlags.Instance | BindingFlags.NonPublic, null, new object[] { }, null); } - - var p = Process.Start(emlFile); - p.Exited += (object lambdaSender, EventArgs lambdaEventArgs) => { - logger.Info("Removing temp file: {0}", emlFile); - File.Delete(emlFile); - }; - p.EnableRaisingEvents = true; + try { + var p = Process.Start(emlFile); + if (p != null) { + p.Exited += (object lambdaSender, EventArgs lambdaEventArgs) => { + logger.Info("Removing temp file: {0}", emlFile); + File.Delete(emlFile); + }; + p.EnableRaisingEvents = true; + } else { + logger.Debug("process was null. most likely the email file format was not known when the process tried to start"); + } + } catch(Exception ex) { + logger.Warn(ex, "An unexpected error has occurred when submitting feedback? {0}", ex.Message); + } } private void ShowSupport(object sender, MouseButtonEventArgs e) { diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 330595ea..a488cb23 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -40,6 +40,8 @@ namespace ZitiDesktopEdge { private static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); + static System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly(); + public static string ThisAssemblyName; public static string ExecutionDirectory; public static string ExpectedLogPathRoot; @@ -47,7 +49,7 @@ namespace ZitiDesktopEdge { public static string ExpectedLogPathServices; static MainWindow() { - var asm = System.Reflection.Assembly.GetExecutingAssembly(); + asm = System.Reflection.Assembly.GetExecutingAssembly(); ThisAssemblyName = asm.GetName().Name; #if DEBUG ExecutionDirectory = @"C:\Program Files (x86)\NetFoundry, Inc\Ziti Desktop Edge";