From 99bb067420871078c40454eec842fad6cbede0f7 Mon Sep 17 00:00:00 2001 From: DimitrisRK Date: Mon, 19 Oct 2020 01:44:27 +0300 Subject: [PATCH] fix(android): BottomNavigation error on back press (application exit) (#8970) --- packages/core/ui/frame/index.android.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/core/ui/frame/index.android.ts b/packages/core/ui/frame/index.android.ts index 91cd68408..bc635bbb9 100644 --- a/packages/core/ui/frame/index.android.ts +++ b/packages/core/ui/frame/index.android.ts @@ -954,10 +954,13 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { const hasRemovingParent = fragment.getRemovingParentFragment(); if (hasRemovingParent) { - const bitmapDrawable = new android.graphics.drawable.BitmapDrawable(application.android.context.getResources(), this.backgroundBitmap); - this.frame._originalBackground = this.frame.backgroundColor || new Color('White'); - this.frame.nativeViewProtected.setBackgroundDrawable(bitmapDrawable); - this.backgroundBitmap = null; + const nativeFrameView = this.frame.nativeViewProtected; + if (nativeFrameView) { + const bitmapDrawable = new android.graphics.drawable.BitmapDrawable(application.android.context.getResources(), this.backgroundBitmap); + this.frame._originalBackground = this.frame.backgroundColor || new Color('White'); + nativeFrameView.setBackgroundDrawable(bitmapDrawable); + this.backgroundBitmap = null; + } } } finally { superFunc.call(fragment);