From 81d8a2d50316c769bb5566541862e0e1e5d263f0 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 19 Sep 2024 12:35:32 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20crash=20if=20there=20isn?= =?UTF-8?q?=E2=80=99t=20a=20GDEF=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ttj/src/context.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ttj/src/context.rs b/ttj/src/context.rs index 983eece..84d255f 100644 --- a/ttj/src/context.rs +++ b/ttj/src/context.rs @@ -15,7 +15,10 @@ pub(crate) struct SerializationContext<'a> { impl<'a> SerializationContext<'a> { pub fn new(font: &'a FontRef<'a>, names: NameMap) -> Result { - let (gdef_regions, gdef_locations) = if let Some(Ok(ivs)) = font.gdef()?.item_var_store() { + let (gdef_regions, gdef_locations) = if let Ok(Some(ivs)) = font + .gdef() + .and_then(|gdef| gdef.item_var_store().transpose()) + { let regions = ivs.variation_region_list()?.variation_regions(); // Find all the peaks