androidmedia: Add more null checks to JNI utilities

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5136>
This commit is contained in:
Ryan Pavlik 2023-07-19 18:08:32 -05:00 committed by Tim-Philipp Müller
parent 11595175e5
commit 903e116cc5

View file

@ -201,6 +201,7 @@ jobject
gst_amc_jni_object_make_global (JNIEnv * env, jobject object)
{
jobject ret;
g_return_val_if_fail (object != NULL, NULL);
ret = (*env)->NewGlobalRef (env, object);
if (!ret) {
@ -215,6 +216,7 @@ jobject
gst_amc_jni_object_ref (JNIEnv * env, jobject object)
{
jobject ret;
g_return_val_if_fail (object != NULL, NULL);
ret = (*env)->NewGlobalRef (env, object);
if (!ret) {