Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7ed3a2b authored by Mike Reed's avatar Mike Reed Committed by Android Git Automerger
Browse files

am 0249c83e: am 31a69fdb: throw if we have a null typeface native instance (so...

am 0249c83e: am 31a69fdb: 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

Merge commit '0249c83e'

* commit '0249c83e':
  throw if we have a null typeface native instance (so we don't crash in native code)
parents 3ea66464 0249c83e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ static SkTypeface* Typeface_createFromTypeface(JNIEnv* env, jobject, SkTypeface*
}
 
static void Typeface_unref(JNIEnv* env, jobject obj, SkTypeface* face) {
    face->unref();
    SkSafeUnref(face);
}

static int Typeface_getStyle(JNIEnv* env, jobject obj, SkTypeface* face) {
+3 −0
Original line number Diff line number Diff line
@@ -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;
    }