Fixed NullPointerException if there's no singleton
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 839624f..b6c90d8 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
@@ -520,7 +520,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/* The native thread has finished */
public static void handleNativeExit() {
SDLActivity.mSDLThread = null;
- mSingleton.finish();
+ if (mSingleton != null) {
+ mSingleton.finish();
+ }
}