[vlc-commits] android/specific: a missing Environment field is not critical

Thomas Guillem git at videolan.org
Mon Jul 18 15:43:08 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul 18 14:57:54 2016 +0200| [0c698c71f11a64cfac8f71bc6b813116b63be22c] | committer: Thomas Guillem

android/specific: a missing Environment field is not critical

The DIRECTORY_DOCUMENTS field is not present before API 19. Not finding a field
is not critical (config_GetUserDir() will just return null for that field).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0c698c71f11a64cfac8f71bc6b813116b63be22c
---

 src/android/specific.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/android/specific.c b/src/android/specific.c
index 1337157..cd064b7 100644
--- a/src/android/specific.c
+++ b/src/android/specific.c
@@ -51,7 +51,10 @@ get_java_string(JNIEnv *env, jclass clazz, const char *psz_name)
     jfieldID id = (*env)->GetStaticFieldID(env, clazz, psz_name,
                                            "Ljava/lang/String;");
     if ((*env)->ExceptionCheck(env))
+    {
+        (*env)->ExceptionClear(env);
         return NULL;
+    }
 
     jstring jstr = (*env)->GetStaticObjectField(env, clazz, id);
 
@@ -113,12 +116,8 @@ JNI_OnLoad(JavaVM *vm, void *reserved)
     for (size_t i = 0; i < GENERIC_DIR_COUNT; ++i)
     {
         if (ppsz_env_names[i] != NULL)
-        {
             ppsz_generic_names[i] = get_java_string(env, clazz,
                                                    ppsz_env_names[i]);
-            if (!ppsz_generic_names[i])
-                goto error;
-        }
     }
 
     fields.Environment.clazz = (*env)->NewGlobalRef(env, clazz);



More information about the vlc-commits mailing list