Prepare for GetMethod to return null and avoid crashing (#107)
Closes #106
This commit is contained in:
parent
cda8e4e625
commit
0f17b3029b
@ -53,7 +53,7 @@ namespace System.Diagnostics
|
|||||||
var method = frame.GetMethod();
|
var method = frame.GetMethod();
|
||||||
|
|
||||||
// Always show last stackFrame
|
// Always show last stackFrame
|
||||||
if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
|
if (method != null && !ShowInStackTrace(method) && i < stackFrames.Length - 1)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ namespace System.Diagnostics
|
|||||||
var row = frame.GetFileLineNumber();
|
var row = frame.GetFileLineNumber();
|
||||||
var column = frame.GetFileColumnNumber();
|
var column = frame.GetFileColumnNumber();
|
||||||
var ilOffset = frame.GetILOffset();
|
var ilOffset = frame.GetILOffset();
|
||||||
if (string.IsNullOrEmpty(fileName) && ilOffset >= 0)
|
if (method != null && string.IsNullOrEmpty(fileName) && ilOffset >= 0)
|
||||||
{
|
{
|
||||||
// .NET Framework and older versions of mono don't support portable PDBs
|
// .NET Framework and older versions of mono don't support portable PDBs
|
||||||
// so we read it manually to get file name and line information
|
// so we read it manually to get file name and line information
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user