From c179d3948aef44e163c3a5684ee64fa00c0964e4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 17 Sep 2018 12:08:05 -0700 Subject: [PATCH] Fixed NullPointerException if there's no singleton --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 4 +++- 1 file changed, 3 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 839624f5e..b6c90d871 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(); + } }