Don't NPE when -nostdlib is used without any -reference

This commit is contained in:
jfrijters 2010-04-23 07:53:21 +00:00
Родитель 14048a6620
Коммит f9b686b757
1 изменённых файлов: 13 добавлений и 10 удалений

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

@ -237,20 +237,23 @@ namespace IKVM.Internal
private int LoadMscorlib(IList<string> references)
{
Universe dummy = new Universe();
foreach (string r in references)
if (references != null)
{
try
Universe dummy = new Universe();
foreach (string r in references)
{
Assembly asm = dummy.LoadFile(r);
if (asm.GetType("System.Object") != null)
try
{
Assembly asm = dummy.LoadFile(r);
if (asm.GetType("System.Object") != null)
{
StaticCompiler.Universe.LoadMscorlib(r);
return 0;
}
}
catch
{
StaticCompiler.Universe.LoadMscorlib(r);
return 0;
}
}
catch
{
}
}
foreach (string mscorlib in FindAssemblyPath("mscorlib.dll"))