From b3d8c9ab49cfc3860881a299de0fb5eef5d84af6 Mon Sep 17 00:00:00 2001 From: jfrijters Date: Fri, 23 Oct 2009 06:08:31 +0000 Subject: [PATCH] Don't crash with NPE if LoadWithPartialName doesn't find the referenced assembly. --- ikvmc/Compiler.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ikvmc/Compiler.cs b/ikvmc/Compiler.cs index 52e8b52b..32775090 100644 --- a/ikvmc/Compiler.cs +++ b/ikvmc/Compiler.cs @@ -411,7 +411,11 @@ class IkvmcCompiler { #pragma warning disable 618 // Assembly.LoadWithPartialName is obsolete - asm = StaticCompiler.LoadFile(Assembly.LoadWithPartialName(r).Location); + Assembly found = Assembly.LoadWithPartialName(r); + if (found != null) + { + asm = StaticCompiler.LoadFile(found.Location); + } #pragma warning restore } catch (FileLoadException)