From 295e87660aa2616913ac8b930b7892e4c20d1cf0 Mon Sep 17 00:00:00 2001 From: be5invis Date: Thu, 20 Aug 2020 08:39:55 -0700 Subject: [PATCH] Fix slab crash when building (#671). --- font-src/glyphs/letter/latin.ptl | 2 ++ font-src/support/glyph.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/font-src/glyphs/letter/latin.ptl b/font-src/glyphs/letter/latin.ptl index 41ed94762..c52693a9a 100644 --- a/font-src/glyphs/letter/latin.ptl +++ b/font-src/glyphs/letter/latin.ptl @@ -3780,8 +3780,10 @@ glyph-block Letter-Latin-Lower-N : begin define [NTopLeftSerif] : begin tagged 'serifLT' : LeftwardTopSerif SB XH SideJut + glyph-proc define [NBottomLeftSerif] : if (!para.isItalic) tagged 'serifLB' : CenterBottomSerif (SB + HalfStroke * HVContrast) 0 Jut + glyph-proc define [NBottomRightSerif] : if (para.isItalic) tagged 'serifRB' : RightwardBottomSerif RightSB 0 SideJut tagged 'serifRB' : CenterBottomSerif (RightSB - HalfStroke * HVContrast) 0 Jut diff --git a/font-src/support/glyph.js b/font-src/support/glyph.js index 54fbb083a..5ffd9414f 100644 --- a/font-src/support/glyph.js +++ b/font-src/support/glyph.js @@ -54,7 +54,9 @@ module.exports = class Glyph { } // Inclusion include(component, copyAnchors, copyWidth) { - if (component instanceof Function) { + if (!component) { + throw new Error("Unreachable: Attempt to include a Null or Undefined"); + } else if (component instanceof Function) { const t = this.defaultTag; if (component.tag) this.defaultTag = component.tag; component.call(this, copyAnchors, copyWidth);