NTP-38969 | first eligible account crash fix (#14986)

This commit is contained in:
Akshita Singh
2025-02-14 18:48:48 +05:30
committed by GitHub
parent 85ff7efe80
commit d3bc1111fe
2 changed files with 10 additions and 11 deletions

View File

@@ -451,15 +451,14 @@ constructor(
)
)
if (lastFailedMandateExecutionTimeStamp == null) {
return
naviCacheRepository.save(
naviCacheEntity =
NaviCacheEntity(
key = KEY_UPI_LITE_LAST_MANDATE_EXECUTION_TIMESTAMP,
value = System.currentTimeMillis().toString(),
version = 1,
)
)
}
naviCacheRepository.save(
naviCacheEntity =
NaviCacheEntity(
key = KEY_UPI_LITE_LAST_MANDATE_EXECUTION_TIMESTAMP,
value = System.currentTimeMillis().toString(),
version = 1,
)
)
}
}

View File

@@ -1477,14 +1477,14 @@ constructor(
// Return first eligible account
// If not found then pick the first from the list
private fun findFirstEligibleAccount(): LinkedAccountEntity {
private fun findFirstEligibleAccount(): LinkedAccountEntity? {
val linkedAccounts =
(bankAccountsState.value as? BankAccountsState.AccountList)?.accounts ?: emptyList()
return linkedAccounts.firstOrNull { it.eligibilityState.isAccountEligible }
?: selectedBankAccount.value
?: linkedAccounts.first()
?: linkedAccounts.firstOrNull()
}
private fun checkIsInternetAvailableOrShowError(