Browse Source

Fix NullReferenceException in GeneralEditorOptions.SaveOptions when closing options dialog before the font list is fully loaded.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6271 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 15 years ago
parent
commit
37e2705abf
  1. 7
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/GeneralEditorOptions.xaml.cs

7
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/GeneralEditorOptions.xaml.cs

@ -41,8 +41,11 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options @@ -41,8 +41,11 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
public override bool SaveOptions()
{
CodeEditorOptions options = CodeEditorOptions.Instance;
options.FontFamily = fontSelectionPanel.CurrentFont.Name;
options.FontSize = Math.Round(fontSelectionPanel.CurrentFont.Size * 96.0 / 72.0);
var font = fontSelectionPanel.CurrentFont;
if (font != null) {
options.FontFamily = font.Name;
options.FontSize = Math.Round(font.Size * 96.0 / 72.0);
}
return base.SaveOptions();
}
}

Loading…
Cancel
Save