From d0947c1483dc29a6629b3b0215331f7ec2725130 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 4 Jun 2020 12:30:25 -0700 Subject: [PATCH] Fixed exception if getManifestEnvironmentVariables() is called without a current SDL activity --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index df58b7173..4cd4276b0 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -1088,6 +1088,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh */ public static boolean getManifestEnvironmentVariables() { try { + if (getContext() == null) { + return false; + } + ApplicationInfo applicationInfo = getContext().getPackageManager().getApplicationInfo(getContext().getPackageName(), PackageManager.GET_META_DATA); Bundle bundle = applicationInfo.metaData; if (bundle == null) {