Avoiding concurrent modification exception

This commit is contained in:
dankito 2024-09-09 17:02:47 +02:00
parent 9b1a5fa929
commit 9372d17313
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ open class TanChallenge(
internal fun userApprovedDecoupledTan(responseAfterApprovingDecoupledTan: BankResponse) {
this.enterTanResult = EnterTanResult(null, true, responseAfterApprovingDecoupledTan)
userApprovedDecoupledTanCallbacks.forEach {
userApprovedDecoupledTanCallbacks.toTypedArray().forEach { // copy to avoid ConcurrentModificationException
try {
it.invoke()
} catch (e: Throwable) {
@ -60,7 +60,7 @@ open class TanChallenge(
}
internal fun tanExpired() {
tanExpiredCallbacks.forEach {
tanExpiredCallbacks.toTypedArray().forEach {
try {
it.invoke()
} catch (e: Throwable) {