Bug 1564294 - Don't iterate over a live list of FileLink accounts when removing a provider. r=Paenglab a=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 09 Jul 2019 13:58:06 +1200
changeset 36057 ae94e2a95a12a8b98d8ea0ae288434b6d6285788
parent 36056 75dffe1c92667a0b883fd6cc4b42aecc891bbb5d
child 36058 dc7ec00ce0defffe39ba0f8dc8763cc6c31cabb6
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;