From efad04c317d1f04ed31d94c119d8f630a895cd8d Mon Sep 17 00:00:00 2001
From: Philipp Wiesemann <philipp.wiesemann@arcor.de>
Date: Fri, 18 Sep 2015 21:26:46 +0200
Subject: [PATCH] Android: Added check if Java method for APK expansion file
 exists.

---
 src/core/android/SDL_android.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c
index 96cc48699..d7bb94ba7 100644
--- a/src/core/android/SDL_android.c
+++ b/src/core/android/SDL_android.c
@@ -788,6 +788,10 @@ fallback:
             /* 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.