Prevent NPE in startActivityUnchecked

Test: manual
Bug: 37931794
Change-Id: I4a968e12cfa99d347f19a8cf2a3b9fba1bf1715b
(cherry picked from commit 625f4936c95657ddbd98663dc9400e0439907e2a)
diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java
index 19b9b45..9e19df7 100644
--- a/services/core/java/com/android/server/am/ActivityStarter.java
+++ b/services/core/java/com/android/server/am/ActivityStarter.java
@@ -1059,7 +1059,7 @@
                 // We didn't do anything...  but it was needed (a.k.a., client don't use that
                 // intent!)  And for paranoia, make sure we have correctly resumed the top activity.
                 resumeTargetStackIfNeeded();
-                if (outActivity.length > 0) {
+                if (outActivity != null && outActivity.length > 0) {
                     outActivity[0] = reusedActivity;
                 }
                 return START_TASK_TO_FRONT;