Browse Source

Fix C# folding crash when the syntax tree is missing positions due to syntax errors.

pull/315/head
Daniel Grunwald 12 years ago
parent
commit
b12d117ed4
  1. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/FoldingVisitor.cs

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/FoldingVisitor.cs

@ -25,7 +25,7 @@ namespace CSharpBinding.Parser @@ -25,7 +25,7 @@ namespace CSharpBinding.Parser
NewFolding AddFolding(TextLocation start, TextLocation end, bool isDefinition = false)
{
if (end.Line <= start.Line)
if (end.Line <= start.Line || start.IsEmpty || end.IsEmpty)
return null;
NewFolding folding = new NewFolding(GetOffset(start), GetOffset(end));
folding.IsDefinition = isDefinition;

Loading…
Cancel
Save