Add missing error reporting in Android_JNI_FileOpen()

Fixes https://github.com/libsdl-org/SDL/issues/8427

(cherry picked from commit a844d90942)
(cherry picked from commit 259009a7ea)
This commit is contained in:
Sam Lantinga committed 2023-10-23 08:28:57 -07:00
1 parent 2ca041d294
commit 5d66429cc3
1 file changed
+2 -2
+2 -2
View File
@@ -1939,12 +1939,12 @@ int Android_JNI_FileOpen(SDL_RWops *ctx,
} }
if (asset_manager == NULL) { if (asset_manager == NULL) {
return -1; return SDL_SetError("Couldn't create asset manager");
} }
asset = AAssetManager_open(asset_manager, fileName, AASSET_MODE_UNKNOWN); asset = AAssetManager_open(asset_manager, fileName, AASSET_MODE_UNKNOWN);
if (asset == NULL) { if (asset == NULL) {
return -1; return SDL_SetError("Couldn't open asset '%s'", fileName);
} }
ctx->hidden.androidio.asset = (void *)asset; ctx->hidden.androidio.asset = (void *)asset;