From d27c0226b4443508a777e1977c43a1fe73ffbf11 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Wed, 20 May 2020 11:35:57 +0200 Subject: [PATCH] Fix #2010: NullReferenceException in SequencePointBuilder.VisitCatchClause() --- ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs b/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs index ce34451a7..7993932c9 100644 --- a/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs @@ -332,7 +332,7 @@ namespace ICSharpCode.Decompiler.CSharp { if (catchClause.Condition.IsNull) { var tryCatchHandler = catchClause.Annotation(); - if (!tryCatchHandler.ExceptionSpecifierILRange.IsEmpty) { + if (tryCatchHandler != null && !tryCatchHandler.ExceptionSpecifierILRange.IsEmpty) { StartSequencePoint(catchClause.CatchToken); var function = tryCatchHandler.Ancestors.OfType().FirstOrDefault(); AddToSequencePointRaw(function, new[] { tryCatchHandler.ExceptionSpecifierILRange });