diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt index 4a62e5b6..f789f51e 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -268,7 +268,7 @@ open class BankingPresenter constructor( open fun fetchAllAccountTransactionsAsync(customer: TypedCustomer, - callback: (GetTransactionsResponse) -> Unit) { + callback: ((GetTransactionsResponse) -> Unit)? = null) { customer.accounts.forEach { bankAccount -> if (bankAccount.supportsRetrievingAccountTransactions) { @@ -278,13 +278,13 @@ open class BankingPresenter constructor( } open fun fetchAllAccountTransactionsAsync(bankAccount: TypedBankAccount, - callback: (GetTransactionsResponse) -> Unit) { + callback: ((GetTransactionsResponse) -> Unit)? = null) { fetchAccountTransactionsAsync(bankAccount, null, false, callback) } open fun fetchAccountTransactionsAsync(bankAccount: TypedBankAccount, fromDate: Date?, abortIfTanIsRequired: Boolean = false, - callback: (GetTransactionsResponse) -> Unit) { + callback: ((GetTransactionsResponse) -> Unit)? = null) { getBankingClientForAccount(bankAccount.customer)?.let { client -> val startDate = Date() @@ -295,7 +295,7 @@ open class BankingPresenter constructor( retrievedAccountTransactions(response, startDate, fromDate == null) } - callback(response) + callback?.invoke(response) } } }