From 34c38e1415e8001c879d085e45e23c313831c3de Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Thu, 7 Oct 2021 13:36:03 -0700 Subject: [PATCH] Fix AssemblyLoading bug If the AssemblyLoader attempted to load a non-csil dll while iterating through the file list, it would catch the exception OUTSIDE the loop, and wouldn't load the rest. This fix makes it catch inside the loop so it will continue iterating. --- AssetStudioUtility/AssemblyLoader.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AssetStudioUtility/AssemblyLoader.cs b/AssetStudioUtility/AssemblyLoader.cs index 40bee80..021b713 100644 --- a/AssetStudioUtility/AssemblyLoader.cs +++ b/AssetStudioUtility/AssemblyLoader.cs @@ -15,18 +15,18 @@ namespace AssetStudio var resolver = new MyAssemblyResolver(); var readerParameters = new ReaderParameters(); readerParameters.AssemblyResolver = resolver; - try + foreach (var file in files) { - foreach (var file in files) + try { var assembly = AssemblyDefinition.ReadAssembly(file, readerParameters); resolver.Register(assembly); moduleDic.Add(assembly.MainModule.Name, assembly.MainModule); } - } - catch - { - // ignored + catch + { + // ignored + } } Loaded = true; }