Merge "Check FontFamily null before adding it." into sc-dev

This commit is contained in:
Joe Hsu
2021-05-13 01:59:02 +00:00
committed by Android (Google) Code Review

View File

@@ -134,7 +134,11 @@ public class FontCustomizationParser {
throw new IllegalArgumentException("customizationType must be specified");
}
if (customizationType.equals("new-named-family")) {
out.add(FontListParser.readFamily(parser, fontDir, updatableFontMap, false));
FontFamily fontFamily = FontListParser.readFamily(
parser, fontDir, updatableFontMap, false);
if (fontFamily != null) {
out.add(fontFamily);
}
} else {
throw new IllegalArgumentException("Unknown customizationType=" + customizationType);
}