Skip to content

Commit

Permalink
Fix NRE in CommentCompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
tintoy committed Jul 2, 2020
1 parent 17da683 commit e5bbfb6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,21 @@ public CommentCompletion(ILogger logger)
return null;
}

Range targetRange = replaceElement.Range;
Range targetRange;

if (replaceElement != null)
{
targetRange = replaceElement.Range;

Log.Verbose("Offering completions to replace element {ElementName} @ {ReplaceRange:l}",
replaceElement.Name,
targetRange
);
}
else
{
targetRange = location.Position.ToEmptyRange();

Log.Verbose("Offering completions to insert element @ {InsertPosition:l}",
location.Position
);
Expand Down

0 comments on commit e5bbfb6

Please sign in to comment.