From 63317dfb1724e0ad0c63a5459e9441c0fa721a34 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 7 Jun 2018 17:07:05 -0700 Subject: [PATCH] Don't crash on exit from SDLActivity if we don't have a singleton for some reason. (Thanks Rachel!) --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 b5e85bdfb..199a408bb 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 @@ -427,7 +427,10 @@ public class SDLActivity extends Activity { /* The native thread has finished */ public static void handleNativeExit() { SDLActivity.mSDLThread = null; - mSingleton.finish(); + + // Make sure we currently have a singleton before we try to call it. + if (mSingleton != null) + mSingleton.finish(); }