From 074d7bb094256a445101a851fb4cd94aeca4574b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 8 Nov 2012 20:51:07 +0100 Subject: [PATCH] nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541). --- src/ChangeLog | 4 ++++ src/nsfont.m | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 24f3305b870..a2f39db5a88 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-11-08 Thomas Kappler (tiny change) + + * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541). + 2012-11-08 Stefan Monnier Use ad-hoc comparison function for the profiler's hash-tables. diff --git a/src/nsfont.m b/src/nsfont.m index 4f29d1d54a9..d2e5108bb7f 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -559,7 +559,11 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch) if (isMatch) [fkeys removeObject: NSFontFamilyAttribute]; - matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys]; + if ([fkeys count] > 0) + matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys]; + else + matchingDescs = [NSMutableArray array]; + if (NSFONT_TRACE) NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc, [matchingDescs count]); -- 2.39.2