Browse Source

Fixed null reference exception in highlighting editor when loading a syntax definition file with Digits/@color set to an unknown color.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3729 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
915738a5c7
  1. 12
      src/AddIns/Misc/HighlightingEditor/Project/Src/EditorHighlightColor.cs

12
src/AddIns/Misc/HighlightingEditor/Project/Src/EditorHighlightColor.cs

@ -123,7 +123,11 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -123,7 +123,11 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
sysForeColorName = c.Substring("SystemColors.".Length);
} else {
PropertyInfo myPropInfo = typeof(Color).GetProperty(c, BindingFlags.Public | BindingFlags.Static);
foreColor = (Color)myPropInfo.GetValue(null, null);
if (myPropInfo != null) {
foreColor = (Color)myPropInfo.GetValue(null, null);
} else {
hasForeColor = false;
}
}
}
@ -137,7 +141,11 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -137,7 +141,11 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
sysBackColorName = c.Substring("SystemColors.".Length);
} else {
PropertyInfo myPropInfo = typeof(Color).GetProperty(c, BindingFlags.Public | BindingFlags.Static);
backColor = (Color)myPropInfo.GetValue(null, null);
if (myPropInfo != null) {
backColor = (Color)myPropInfo.GetValue(null, null);
} else {
hasBackColor = false;
}
}
}
}

Loading…
Cancel
Save