Browse Source

Fix NullReferenceException when find references returns a result in a file without highlighter.

pull/28/head
Daniel Grunwald 14 years ago
parent
commit
e7c9e76f3d
  1. 3
      src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs

3
src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs

@ -389,7 +389,8 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -389,7 +389,8 @@ namespace ICSharpCode.SharpDevelop.Refactoring
var start = document.GetLocation(r.Offset).ToLocation();
var end = document.GetLocation(r.Offset + r.Length).ToLocation();
var builder = SearchResultsPad.CreateInlineBuilder(start, end, document, highlighter);
SearchResultMatch res = new SearchResultMatch(fileName, start, end, r.Offset, r.Length, builder, highlighter.DefaultTextColor);
var defaultTextColor = highlighter != null ? highlighter.DefaultTextColor : null;
SearchResultMatch res = new SearchResultMatch(fileName, start, end, r.Offset, r.Length, builder, defaultTextColor);
results.Add(res);
}
SearchResultsPad.Instance.ShowSearchResults(title, results);

Loading…
Cancel
Save