Browse Source

Fix null reference exception when opening .txt files.

TextContentCondition now handles files that have no syntax
highlighting defined.
newNRvisualizers
Matt Ward 13 years ago
parent
commit
3644447a7e
  1. 2
      src/Main/SharpDevelop/Editor/TextContentCondition.cs

2
src/Main/SharpDevelop/Editor/TextContentCondition.cs

@ -23,7 +23,7 @@ namespace ICSharpCode.SharpDevelop.Editor @@ -23,7 +23,7 @@ namespace ICSharpCode.SharpDevelop.Editor
{
string textcontent = condition.Properties["textcontent"];
var editor = SD.GetActiveViewContentService<ICSharpCode.AvalonEdit.TextEditor>();
if (editor != null) {
if (editor != null && editor.SyntaxHighlighting != null) {
return string.Equals(textcontent, editor.SyntaxHighlighting.Name, StringComparison.OrdinalIgnoreCase);
}
return false;

Loading…
Cancel
Save