Android: Added check if Java method for APK expansion file exists.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Fri, 18 Sep 2015 21:26:46 +0200
changeset 9873 b0f121cfa074
parent 9872 1052f7697d6f
child 9874 320f337e816a
Android: Added check if Java method for APK expansion file exists.
src/core/android/SDL_android.c
--- a/src/core/android/SDL_android.c	Fri Sep 18 21:26:28 2015 +0200
+++ b/src/core/android/SDL_android.c	Fri Sep 18 21:26:46 2015 +0200
@@ -788,6 +788,10 @@
             /* Try fallback to APK expansion files */
             mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, context),
                 "openAPKExpansionInputStream", "(Ljava/lang/String;)Ljava/io/InputStream;");
+            if (!mid) {
+                SDL_SetError("No openAPKExpansionInputStream() in Java class");
+                goto failure; /* Java class is missing the required method */
+            }
             inputStream = (*mEnv)->CallObjectMethod(mEnv, context, mid, fileNameJString);
 
             /* Exception is checked first because it always needs to be cleared.