diff --git a/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs b/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs index d2bdf7af9e..26a1d49346 100644 --- a/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs +++ b/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs @@ -420,7 +420,8 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis falseEnd = ifElseStatement.FalseStatement.AcceptVisitor(this, falseBegin); } ControlFlowNode end = builder.CreateEndNode(ifElseStatement); - Connect(trueEnd, end); + if (trueEnd != null) + Connect(trueEnd, end); if (falseEnd != null) { Connect(falseEnd, end); } else if (cond != true) {