Skip to content

Commit a75f001

Browse files
committed
Bug 1989335 - Copy permission list before iterating r=segun
Pull request: mozilla-firefox/firefox#24
1 parent e05974a commit a75f001

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/permission/GeckoPermissionRequest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ sealed class GeckoPermissionRequest constructor(
7979

8080
override fun grant(permissions: List<Permission>) {
8181
if (!isCompleted) {
82-
geckoResults.forEach {
82+
geckoResults.toList().forEach {
8383
it.complete(VALUE_ALLOW)
8484
}
8585
}
@@ -88,7 +88,7 @@ sealed class GeckoPermissionRequest constructor(
8888

8989
override fun reject() {
9090
if (!isCompleted) {
91-
geckoResults.forEach {
91+
geckoResults.toList().forEach {
9292
it.complete(VALUE_DENY)
9393
}
9494
}
@@ -153,13 +153,13 @@ sealed class GeckoPermissionRequest constructor(
153153
}
154154

155155
override fun grant(permissions: List<Permission>) {
156-
callbacks.forEach {
156+
callbacks.toList().forEach {
157157
it.grant()
158158
}
159159
}
160160

161161
override fun reject() {
162-
callbacks.forEach {
162+
callbacks.toList().forEach {
163163
it.reject()
164164
}
165165
}

0 commit comments

Comments
 (0)