Merge "Don't call surface.remove if surface is null." into oc-mr1-dev
diff --git a/services/core/java/com/android/server/wm/AppWindowContainerController.java b/services/core/java/com/android/server/wm/AppWindowContainerController.java
index 1ca98ac..f142ff6 100644
--- a/services/core/java/com/android/server/wm/AppWindowContainerController.java
+++ b/services/core/java/com/android/server/wm/AppWindowContainerController.java
@@ -632,9 +632,12 @@
                 mContainer.startingSurface = null;
                 mContainer.startingWindow = null;
                 mContainer.startingDisplayed = false;
-                if (surface == null && DEBUG_STARTING_WINDOW) {
-                    Slog.v(TAG_WM, "startingWindow was set but startingSurface==null, couldn't "
-                            + "remove");
+                if (surface == null) {
+                    if (DEBUG_STARTING_WINDOW) {
+                        Slog.v(TAG_WM, "startingWindow was set but startingSurface==null, couldn't "
+                                + "remove");
+                    }
+                    return;
                 }
             } else {
                 if (DEBUG_STARTING_WINDOW) {