From 9f6f1ee96e95815284fb046dfe157ba9a2927dbe Mon Sep 17 00:00:00 2001 From: Trivalik <3148279+trivalik@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:25:31 +0100 Subject: [PATCH] fix #3372 empty tree for assembly --- ICSharpCode.ILSpyX/LoadedAssembly.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.ILSpyX/LoadedAssembly.cs b/ICSharpCode.ILSpyX/LoadedAssembly.cs index 26c063e5d9..9bc935b00f 100644 --- a/ICSharpCode.ILSpyX/LoadedAssembly.cs +++ b/ICSharpCode.ILSpyX/LoadedAssembly.cs @@ -353,7 +353,7 @@ async Task LoadAsync(Task? streamTask) } } - if (result?.IsSuccess != true) + if (result?.IsSuccess != true || result.Package?.Kind == LoadedPackage.PackageKind.Zip) // workaround to check this before zip { stream.Position = 0; try @@ -367,7 +367,8 @@ async Task LoadAsync(Task? streamTask) } catch (Exception ex) { - result = new LoadResult { FileLoadException = ex }; + if (result == null) + result = new LoadResult { FileLoadException = ex }; } }