[Android] add missing null check to java object for hcpp mode. (#163165)
This can be hit if the FlutterJNI has been disconnected. In this case, it is correct to return a nullptr as the engine can create its own trasnaction.
This commit is contained in:
parent
1c0a76d031
commit
a0dca0c30a
@ -2023,16 +2023,18 @@ ASurfaceTransaction* PlatformViewAndroidJNIImpl::createTransaction() {
|
||||
JNIEnv* env = fml::jni::AttachCurrentThread();
|
||||
|
||||
auto java_object = java_object_.get(env);
|
||||
if (java_object.is_null()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
fml::jni::ScopedJavaLocalRef<jobject> transaction(
|
||||
env,
|
||||
env->CallObjectMethod(java_object.obj(), g_create_transaction_method));
|
||||
|
||||
if (transaction.is_null()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FML_CHECK(fml::jni::CheckException(env));
|
||||
|
||||
return impeller::android::GetProcTable().ASurfaceTransaction_fromJava(
|
||||
env, transaction.obj());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user