We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c0bbd5 commit 49bd354Copy full SHA for 49bd354
lib/src/main/java/at/bitfire/cert4android/UserDecisionRegistry.kt
@@ -57,8 +57,13 @@ class UserDecisionRegistry private constructor(
57
getUserDecision: suspend (X509Certificate) -> Boolean
58
): Boolean = suspendCancellableCoroutine { cont ->
59
cont.invokeOnCancellation {
60
- // remove from pending decisions on cancellation
61
- pendingDecisions[cert]?.remove(cont)
+ val decisionsList = pendingDecisions[cert]
+ // remove from pending decisions on cancellation from list
62
+ decisionsList?.remove(cont)
63
+
64
+ // Remove decisions list if empty
65
+ if (decisionsList?.isEmpty() == true)
66
+ pendingDecisions.remove(cert)
67
}
68
69
synchronized(pendingDecisions) {
0 commit comments