From 37c0731a8a58cd4cc0a35b69962c1b7cbd464f22 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Wed, 11 Aug 2021 14:41:24 -0300 Subject: [PATCH] fix(android): onSaveInstanceState should not crash when no rootView is set (#9447) --- packages/core/ui/frame/index.android.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/ui/frame/index.android.ts b/packages/core/ui/frame/index.android.ts index a7ae9ee9a..41f7917fe 100644 --- a/packages/core/ui/frame/index.android.ts +++ b/packages/core/ui/frame/index.android.ts @@ -1110,7 +1110,9 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks { rootView._saveFragmentsState(); } - outState.putInt(ROOT_VIEW_ID_EXTRA, rootView._domId); + if (rootView) { + outState.putInt(ROOT_VIEW_ID_EXTRA, rootView._domId); + } } @profile