From a5e9d65852f2a87b7c17dd9d4d3ea63d648519b2 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Tue, 27 Jan 2026 20:03:05 +0100 Subject: [PATCH] fixed: fontpanel was crashing --- AppKit/AppKit.j | 1 + AppKit/CPTextView/CPFontPanel.j | 3 +++ 2 files changed, 4 insertions(+) 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];