[libbluray-devel] bdj_make_array(): log NewObjectArray() failures
hpi1
git at videolan.org
Thu Mar 30 11:55:17 CEST 2017
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Mar 27 15:31:34 2017 +0300| [d9ad5155b96f125b99e9e3279c1d8cd345d25729] | committer: hpi1
bdj_make_array(): log NewObjectArray() failures
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=d9ad5155b96f125b99e9e3279c1d8cd345d25729
---
src/libbluray/bdj/native/util.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/native/util.c b/src/libbluray/bdj/native/util.c
index 12fab99..bf4e97a 100644
--- a/src/libbluray/bdj/native/util.c
+++ b/src/libbluray/bdj/native/util.c
@@ -48,10 +48,19 @@ jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...)
jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count)
{
- jclass arr_class = (*env)->FindClass(env, name);
+ jobjectArray arr;
+ jclass arr_class;
+
+ arr_class = (*env)->FindClass(env, name);
if (!arr_class) {
BD_DEBUG(DBG_BDJ | DBG_CRIT, "Class %s not found\n", name);
return NULL;
}
- return (*env)->NewObjectArray(env, count, arr_class, NULL);
+
+ arr = (*env)->NewObjectArray(env, count, arr_class, NULL);
+ if (!arr) {
+ BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to create %s\n", name);
+ }
+
+ return arr;
}
More information about the libbluray-devel
mailing list