diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index 614c1dfda..e907b7918 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -2029,10 +2029,14 @@ const char * SDL_AndroidGetInternalStoragePath(void) return NULL; } - /* path = fileObject.getAbsolutePath(); */ + /* path = fileObject.getCanonicalPath(); */ mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), - "getAbsolutePath", "()Ljava/lang/String;"); + "getCanonicalPath", "()Ljava/lang/String;"); pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); + if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } path = (*env)->GetStringUTFChars(env, pathString, NULL); s_AndroidInternalFilesPath = SDL_strdup(path);