Browse Source

Fixed possible null reference exception.

newNRvisualizers
mike 14 years ago
parent
commit
54b3baee81
  1. 2
      ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs

2
ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs

@ -430,6 +430,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion @@ -430,6 +430,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
bool wrapInClass = memberLocation != new TextLocation (1, 1);
if (wrapInClass) {
var nodeAtLocation = Unit.GetNodeAt (memberLocation, n => n is TypeDeclaration || n is NamespaceDeclaration);
if (nodeAtLocation != null) {
foreach (var n in nodeAtLocation.AncestorsAndSelf) {
if (memberLocation == n.StartLocation) {
continue;
@ -459,6 +460,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion @@ -459,6 +460,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
}
}
}
}
wrapper.Append(memberText);
wrapper.Append(continuation);
AppendMissingClosingBrackets(wrapper, memberText, appendSemicolon);

Loading…
Cancel
Save