From 1e390eed1e3c74e4daba9ec46eba0c162c946d94 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 8 Aug 2014 13:48:52 +0400 Subject: [PATCH] catch exceptions during app command line parsing. --- App.xaml.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index d6f8c48c..d612cc04 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -67,20 +67,20 @@ namespace GARbro.GUI Trace.AutoFlush = true; #endif Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App"); - if (0 != e.Args.Length) + try { - InitPath = Path.GetFullPath (e.Args[0]); - } - else if (!string.IsNullOrEmpty (Settings.Default.appLastDirectory)) - { - try + if (0 != e.Args.Length) + { + InitPath = Path.GetFullPath (e.Args[0]); + } + else if (!string.IsNullOrEmpty (Settings.Default.appLastDirectory)) { string last_dir = Settings.Default.appLastDirectory; Directory.SetCurrentDirectory (last_dir); InitPath = last_dir; } - catch { } } + catch { } if (string.IsNullOrEmpty (InitPath)) InitPath = Directory.GetCurrentDirectory();