Skip to content

Commit 97955b2

Browse files
committed
Avoid module-load crash from eager currentActivity access
(cherry picked from commit 03709fc9cbf0900334d1fa7ec19cf3fd2f89e1d9)
1 parent a17cde7 commit 97955b2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

android/src/main/java/com/expensify/wallet/WalletModule.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
4646
const val E_INVALID_DATA = "E_INVALID_DATA"
4747
}
4848

49-
private val activity = reactApplicationContext.currentActivity ?: throw ActivityNotFoundException()
50-
private val tapAndPayClient: TapAndPayClient = TapAndPay.getClient(activity)
49+
private val activity: Activity
50+
get() = reactApplicationContext.currentActivity ?: throw ActivityNotFoundException()
51+
52+
private val tapAndPayClient: TapAndPayClient
53+
get() = TapAndPay.getClient(activity)
5154
private var pendingCreateWalletPromise: Promise? = null
5255
private var pendingPushTokenizePromise: Promise? = null
5356

0 commit comments

Comments
 (0)