Check whether the lookup of android.hardware.HardwareBuffer found a class (flutter/engine#44304)

This commit is contained in:
Jason Simmons
2023-08-02 17:24:11 -07:00
committed by GitHub
parent 5b6a8bc86f
commit d98f151c47

View File

@@ -1211,7 +1211,7 @@ bool PlatformViewAndroid::Register(JNIEnv* env) {
g_hardware_buffer_class = new fml::jni::ScopedJavaGlobalRef<jclass>(
env, env->FindClass("android/hardware/HardwareBuffer"));
if (g_hardware_buffer_class != nullptr) {
if (!g_hardware_buffer_class->is_null()) {
g_hardware_buffer_close_method =
env->GetMethodID(g_hardware_buffer_class->obj(), "close", "()V");
} else {