diff --git a/code/client/clrcore/InternalManager.cs b/code/client/clrcore/InternalManager.cs index 9c23704117..a535b0ff9e 100644 --- a/code/client/clrcore/InternalManager.cs +++ b/code/client/clrcore/InternalManager.cs @@ -585,6 +585,7 @@ private void PrintError(string where, Exception what) IEnumerable stackFrames; // HACK: workaround to iterate inner traces ourselves. + // TODO: remove this once we've updated libraries var fieldCapturedTraces = typeof(StackTrace).GetField("captured_traces", BindingFlags.NonPublic | BindingFlags.Instance); if (fieldCapturedTraces != null) { @@ -592,7 +593,7 @@ private void PrintError(string where, Exception what) // client's mscorlib is missing this piece of code, copied from https://github.com/mono/mono/blob/ef848cfa83ea16b8afbd5b933968b1838df19505/mcs/class/corlib/System.Diagnostics/StackTrace.cs#L181 var accum = new List(); - foreach (var t in captured_traces) + foreach (var t in captured_traces ?? Array.Empty()) { for (int i = 0; i < t.FrameCount; i++) accum.Add(t.GetFrame(i));