From e0d3cff573cbd38da29a414c7a25750af91715a1 Mon Sep 17 00:00:00 2001 From: Maik Macho Date: Thu, 10 May 2018 16:22:21 +0200 Subject: [PATCH] Ignore unreadable assemblies --- lib-projs/FNA | 2 +- src/XnaToFnaUtil.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib-projs/FNA b/lib-projs/FNA index 39b2754..b7d4924 160000 --- a/lib-projs/FNA +++ b/lib-projs/FNA @@ -1 +1 @@ -Subproject commit 39b27547c5d14779033668ae1c017e2be8cfcf13 +Subproject commit b7d49243316d35345ab1a0f2bb830e1f00a1c1ca diff --git a/src/XnaToFnaUtil.cs b/src/XnaToFnaUtil.cs index 28ba4af..563a728 100644 --- a/src/XnaToFnaUtil.cs +++ b/src/XnaToFnaUtil.cs @@ -253,7 +253,13 @@ public void ScanPath(string path) { if (!File.Exists(path + ".mdb") && !File.Exists(Path.ChangeExtension(path, "pdb"))) modReaderParams.ReadSymbols = false; Log($"[ScanPath] Checking assembly {name.Name} ({(modReaderParams.ReadWrite ? "rw" : "r-")})"); - ModuleDefinition mod = MonoModExt.ReadModule(path, modReaderParams); + ModuleDefinition mod; + try { + mod = MonoModExt.ReadModule(path, modReaderParams); + } catch (Exception e) { + Log($"[ScanPath] WARNING: Cannot load assembly: {e}"); + return; + } bool add = !modReaderParams.ReadWrite || name.Name == ThisAssemblyName; if ((mod.Attributes & ModuleAttributes.ILOnly) != ModuleAttributes.ILOnly) {