diff options
| author | 2014-08-20 14:59:17 -0400 | |
|---|---|---|
| committer | 2014-08-20 16:11:59 -0400 | |
| commit | bf8d5620f7f3be72ec217f4bcc14a417d4e1dee6 (patch) | |
| tree | 812dd56e49003cd848f3a2f70e1c4c912258d677 /graphics/java/android | |
| parent | 80030f90b61cc5479382264966bf1b7bf66f10c8 (diff) | |
Throw exception on nonexistent font
In K, this used to throw RuntimeException. Before this patch, NULL
was returned and no exceptions thrown. With this patch,
FileNotFoundException is thrown. This might be considered API
change and be undesirable as callers need to either catch it or
declare it to be thrown.
Bug: 16180181
Change-Id: If83d76857f640c6293a3d5d08fb89ceddbaf41bc
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/graphics/Typeface.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java index 06586ca85e2d..568d3f2aad4e 100644 --- a/graphics/java/android/graphics/Typeface.java +++ b/graphics/java/android/graphics/Typeface.java @@ -188,7 +188,7 @@ public class Typeface { return createFromFamiliesWithDefault(families); } } - return null; + throw new RuntimeException("Font asset not found " + path); } /** @@ -215,7 +215,7 @@ public class Typeface { return createFromFamiliesWithDefault(families); } } - return null; + throw new RuntimeException("Font not found " + path); } /** |