Browse Source

Fix #2010: NullReferenceException in SequencePointBuilder.VisitCatchClause()

pull/2016/head
Siegfried Pammer 5 years ago
parent
commit
d27c0226b4
  1. 2
      ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs

2
ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs

@ -332,7 +332,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -332,7 +332,7 @@ namespace ICSharpCode.Decompiler.CSharp
{
if (catchClause.Condition.IsNull) {
var tryCatchHandler = catchClause.Annotation<TryCatchHandler>();
if (!tryCatchHandler.ExceptionSpecifierILRange.IsEmpty) {
if (tryCatchHandler != null && !tryCatchHandler.ExceptionSpecifierILRange.IsEmpty) {
StartSequencePoint(catchClause.CatchToken);
var function = tryCatchHandler.Ancestors.OfType<ILFunction>().FirstOrDefault();
AddToSequencePointRaw(function, new[] { tryCatchHandler.ExceptionSpecifierILRange });

Loading…
Cancel
Save