Don't crash with NPE if LoadWithPartialName doesn't find the referenced assembly.

This commit is contained in:
jfrijters 2009-10-23 06:08:31 +00:00
Родитель dc92060a5a
Коммит b3d8c9ab49
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -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)