summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2009-12-14 14:57:01 -0500
committerMike Reed <reed@google.com>2009-12-17 12:18:44 -0500
commit31a69fdbe1edd8d686043e8ca7d278289f65808e (patch)
treee6f5e22a0149a7239cd8a13d2cfdf9f743bede77 /graphics/java
parente96b6838b5a7ec3b4368e2449af9fbf0a8b75f16 (diff)
downloadframeworks_base-31a69fdbe1edd8d686043e8ca7d278289f65808e.zip
frameworks_base-31a69fdbe1edd8d686043e8ca7d278289f65808e.tar.gz
frameworks_base-31a69fdbe1edd8d686043e8ca7d278289f65808e.tar.bz2
throw if we have a null typeface native instance (so we don't crash in native code)
we may still have to native-destroy a Typeface with a null ref, so check for that
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/Typeface.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java
index f0d5a6a..bc92d3a 100644
--- a/graphics/java/android/graphics/Typeface.java
+++ b/graphics/java/android/graphics/Typeface.java
@@ -143,6 +143,9 @@ public class Typeface {
// don't allow clients to call this directly
private Typeface(int ni) {
+ if (0 == ni) {
+ throw new RuntimeException("native typeface cannot be made");
+ }
native_instance = ni;
}