From 45536710f393991e1dd798e2f6d34e12fc34e3f2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 24 Oct 2017 00:04:40 -0700 Subject: [PATCH] Fixed crash if mSurface isn't set up when we pause the application --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 3 ++- 1 file changed, 2 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 3d6832e98..7807fc7b2 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 @@ -354,7 +354,8 @@ public class SDLActivity extends Activity { // Try a transition to paused state if (mNextNativeState == NativeState.PAUSED) { nativePause(); - mSurface.handlePause(); + if (mSurface != null) + mSurface.handlePause(); mCurrentNativeState = mNextNativeState; return; }