Handle case were there is no user class loader.

This commit is contained in:
jfrijters 2009-04-06 05:23:04 +00:00
Родитель 23b8f6a695
Коммит 0743299862
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -459,13 +459,13 @@ namespace IKVM.NativeCode.java
{
// testing shows that it is cheaper the get the full stack trace and then look at a few frames than getting the frames individually
StackTrace trace = new StackTrace(2, false);
for (int i = 0; ; i++)
for (int i = 0; i < trace.FrameCount; i++)
{
StackFrame frame = trace.GetFrame(i);
MethodBase method = frame.GetMethod();
if (method == null)
{
return null;
continue;
}
Type type = method.DeclaringType;
if (type != null)
@ -486,6 +486,7 @@ namespace IKVM.NativeCode.java
}
}
}
return null;
}
}