summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorRiddle Hsu <riddlehsu@google.com>2021-08-04 05:38:15 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-08-04 05:38:15 +0000
commit36b8c779f65c73a3c8b8e25ebe9dc2882843f121 (patch)
tree2cf749efbe459865479d8346872a1e8d00b5cf71 /core/java
parentd3b8eb318c73e4115e91e7150a47d50da403b15e (diff)
parent6c675a3a48260077dedfd23679f55d833f3ea526 (diff)
Fix NPE when calling recreate in onCreate am: 6c675a3a48
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15435289 Change-Id: Ie56c2b12698b48a64d104653e36d498fa9f966ff
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ActivityThread.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index dbaf2757a9e2..0c64c86daf3e 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -5654,8 +5654,8 @@ public final class ActivityThread extends ClientTransactionHandler
*/
private void scheduleRelaunchActivityIfPossible(@NonNull ActivityClientRecord r,
boolean preserveWindow) {
- if (r.activity.mFinished || r.token instanceof Binder) {
- // Do not schedule relaunch if the activity is finishing or not a local object (e.g.
+ if ((r.activity != null && r.activity.mFinished) || r.token instanceof Binder) {
+ // Do not schedule relaunch if the activity is finishing or is a local object (e.g.
// created by ActivtiyGroup that server side doesn't recognize it).
return;
}