diff --git a/AppKit/AppKit.j b/AppKit/AppKit.j index 99f532131..a893e0204 100644 --- a/AppKit/AppKit.j +++ b/AppKit/AppKit.j @@ -115,3 +115,4 @@ @import "CPWindow.j" @import "CPWindowController.j" @import "CPWorkspace.j" +@import "CPFontPanel.j" diff --git a/AppKit/CPTextView/CPFontPanel.j b/AppKit/CPTextView/CPFontPanel.j index b3abeece7..4dbe710b2 100644 --- a/AppKit/CPTextView/CPFontPanel.j +++ b/AppKit/CPTextView/CPFontPanel.j @@ -197,6 +197,9 @@ var _availableTraits= [@"Normal", @"Italic", @"Bold", @"Bold Italic"], if (![self isVisible]) return; + if (![textView respondsToSelector:@selector(_attributesForFontPanel)]) + return; + var attribs = [textView _attributesForFontPanel], font = [attribs objectForKey:CPFontAttributeName] || [[textView textStorage] font] || [CPFont systemFontOfSize:12.0], color = [attribs objectForKey:CPForegroundColorAttributeName];