From a844d909426153985136433f28ee5621affce97e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 23 Oct 2023 08:27:24 -0700 Subject: [PATCH] Add missing error reporting in Android_JNI_FileOpen() Fixes https://github.com/libsdl-org/SDL/issues/8427 --- src/core/android/SDL_android.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index 34c939e3b..8bf816610 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -1975,12 +1975,12 @@ int Android_JNI_FileOpen(SDL_RWops *ctx, } if (asset_manager == NULL) { - return -1; + return SDL_SetError("Couldn't create asset manager"); } asset = AAssetManager_open(asset_manager, fileName, AASSET_MODE_UNKNOWN); if (asset == NULL) { - return -1; + return SDL_SetError("Couldn't open asset '%s'", fileName); } ctx->hidden.androidio.asset = (void *)asset;