Bug 1564294 - Don't iterate over a live list of FileLink accounts when removing a provider. r=Paenglab a=jorgk BETA_68_CONTINUATION
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 09 Jul 2019 13:58:06 +1200
branchBETA_68_CONTINUATION
changeset 36067 3e28f14a9c2625831d8cc23143f410b67b5c8e21
parent 36066 1595c78e35881b6516a228e355f20405c7432ae6
child 36068 96624d62b756ba7ecd2df24958fad0caf13a85f4
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersPaenglab, jorgk
bugs1564294
Bug 1564294 - Don't iterate over a live list of FileLink accounts when removing a provider. r=Paenglab a=jorgk
mail/components/preferences/applications.js
--- a/mail/components/preferences/applications.js
+++ b/mail/components/preferences/applications.js
@@ -589,17 +589,17 @@ var gCloudFileTab = {
       this._list.appendChild(item);
     }
 
     this._buttonContainer.appendChild(this.makeButtonForProvider(provider));
     this._listContainer.appendChild(this.makeListItemForProvider(provider));
   },
 
   _onProviderUnregistered(event, type) {
-    for (let item of this._list.children) {
+    for (let item of [...this._list.children]) {
       // If the provider is unregistered, getAccount returns null.
       if (!cloudFileAccounts.getAccount(item.value)) {
         if (item.hasAttribute("selected")) {
           this._settingsDeck.selectedPanel = this._defaultPanel;
           if (this._settings) {
             this._settings.remove();
           }
           this._removeAccountButton.disabled = true;