From 31a69fdbe1edd8d686043e8ca7d278289f65808e Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Mon, 14 Dec 2009 14:57:01 -0500 Subject: 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 --- graphics/java/android/graphics/Typeface.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'graphics/java') 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; } -- cgit v1.1