Commit 45536710f393991e1dd798e2f6d34e12fc34e3f2

Sam Lantinga 2017-10-24T00:04:40

Fixed crash if mSurface isn't set up when we pause the application

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 3d6832e..7807fc7 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;
         }