Fixed exception if getManifestEnvironmentVariables() is called without a current SDL activity
authorSam Lantinga <slouken@libsdl.org>
Thu, 04 Jun 2020 12:30:25 -0700
changeset 13898aa9d7c43a982
parent 13897 a5760e2701a3
child 13899 4ecca6f93aa5
Fixed exception if getManifestEnvironmentVariables() is called without a current SDL activity
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
     1.1 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Thu Jun 04 12:26:57 2020 -0700
     1.2 +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Thu Jun 04 12:30:25 2020 -0700
     1.3 @@ -1088,6 +1088,10 @@
     1.4       */
     1.5      public static boolean getManifestEnvironmentVariables() {
     1.6          try {
     1.7 +            if (getContext() == null) {
     1.8 +                return false;
     1.9 +            }
    1.10 +
    1.11              ApplicationInfo applicationInfo = getContext().getPackageManager().getApplicationInfo(getContext().getPackageName(), PackageManager.GET_META_DATA);
    1.12              Bundle bundle = applicationInfo.metaData;
    1.13              if (bundle == null) {