Skip to content

Commit

Permalink
fix crash when fragment manager doesn't support remove() (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccen-stripe authored Jun 3, 2024
1 parent fbac417 commit 3797e19
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class StripeIdentityReactNativeModule(reactContext: ReactApplicationContext) : R

// If a fragment was already initialized, we want to remove it first
stripeIdentityVerificationSheetFragment?.let {
activity.supportFragmentManager.beginTransaction().remove(it).commitAllowingStateLoss()
runCatching {
activity.supportFragmentManager.beginTransaction().remove(it).commitAllowingStateLoss()
}
}
stripeIdentityVerificationSheetFragment = StripeIdentityVerificationSheetFragment().also {
val bundle = toBundleObject(options)
Expand Down

0 comments on commit 3797e19

Please sign in to comment.