diff --git a/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivity.kt b/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivity.kt index eee8af3fc..689a6aa4c 100644 --- a/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivity.kt @@ -102,7 +102,8 @@ open class ExternalAppBrowserActivity : HomeActivity() { // exists then remove it now to free all its resources. Once this activity is finished // then there's no way to get back to it other than relaunching it. val tabId = getExternalTabId() - if (tabId != null) { + val customTab = tabId?.let { components.core.store.state.findCustomTab(it) } + if (tabId != null && customTab != null) { components.useCases.customTabsUseCases.remove(tabId) } }