Browse Source

Fixed NullPointerException if there's no singleton

Sam Lantinga 7 years ago
parent
commit
c179d3948a

+ 3 - 1
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

@@ -520,7 +520,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
     /* The native thread has finished */
     /* The native thread has finished */
     public static void handleNativeExit() {
     public static void handleNativeExit() {
         SDLActivity.mSDLThread = null;
         SDLActivity.mSDLThread = null;
-        mSingleton.finish();
+        if (mSingleton != null) {
+            mSingleton.finish();
+        }
     }
     }