Skip to content

Commit 38581c9

Browse files
Romain GuyAndroid Code Review
authored andcommitted
Merge "Improved error handling when font loading fails."
2 parents e25863c + 417675c commit 38581c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graphics/java/android/graphics/Typeface.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ public static Typeface createFromFile(String path) {
143143

144144
// don't allow clients to call this directly
145145
private Typeface(int ni) {
146+
if (ni == 0) {
147+
throw new IllegalStateException();
148+
}
146149
native_instance = ni;
147150
}
148151

0 commit comments

Comments
 (0)