diff --git a/java/src/com/google/typography/font/sfntly/table/opentype/component/RuleSegment.java b/java/src/com/google/typography/font/sfntly/table/opentype/component/RuleSegment.java index d1381985..0ae12a5d 100644 --- a/java/src/com/google/typography/font/sfntly/table/opentype/component/RuleSegment.java +++ b/java/src/com/google/typography/font/sfntly/table/opentype/component/RuleSegment.java @@ -12,15 +12,20 @@ class RuleSegment extends LinkedList { } RuleSegment(GlyphGroup glyphGroup) { - addInternal(glyphGroup); + if (glyphGroup != null) + addInternal(glyphGroup); } RuleSegment(int glyph) { + if (glyph < 0) + return; GlyphGroup glyphGroup = new GlyphGroup(glyph); addInternal(glyphGroup); } RuleSegment(GlyphList glyphs) { + if (glyphs == null) + return; for (int glyph : glyphs) { GlyphGroup glyphGroup = new GlyphGroup(glyph); addInternal(glyphGroup);