From bf5677c3cdfb941b0bb7b71145f50d653268d2bc Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 16 Feb 2012 16:37:51 +0100 Subject: [PATCH] Fix crash when starting ILSpy without /navigateTo. --- ILSpy/ILSpy.csproj | 2 +- ILSpy/MainWindow.xaml.cs | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 2253f057c..eee97c1bd 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -17,7 +17,7 @@ false Images\ILSpy.ico False - /separate "C:\temp\decompiled\Mono.Cecil.dll" + /separate True ..\NRefactory\ICSharpCode.NRefactory.snk False diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 000aa5e6a..c11516d48 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -294,16 +294,6 @@ namespace ICSharpCode.ILSpy // NavigateTo == null and an assembly was given on the command-line: // Select the newly loaded assembly JumpToReference(commandLineLoadedAssemblies[0].AssemblyDefinition); - } else { - SharpTreeNode node = FindNodeByPath(sessionSettings.ActiveTreeViewPath, true); - if (node != null) { - SelectNode(node); - - // only if not showing the about page, perform the update check: - ShowMessageIfUpdatesAvailableAsync(spySettings); - } else { - AboutPage.Display(decompilerTextView); - } } commandLineLoadedAssemblies.Clear(); // clear references once we don't need them anymore } @@ -328,6 +318,17 @@ namespace ICSharpCode.ILSpy ShowAssemblyList(this.assemblyList); HandleCommandLineArgumentsAfterShowList(App.CommandLineArguments); + if (App.CommandLineArguments.NavigateTo == null && App.CommandLineArguments.AssembliesToLoad.Count != 1) { + SharpTreeNode node = FindNodeByPath(sessionSettings.ActiveTreeViewPath, true); + if (node != null) { + SelectNode(node); + + // only if not showing the about page, perform the update check: + ShowMessageIfUpdatesAvailableAsync(spySettings); + } else { + AboutPage.Display(decompilerTextView); + } + } } #region Update Check