Bug 1564294 - Don't iterate over a live list of FileLink accounts when removing a provider. r=Paenglab
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 09 Jul 2019 13:58:06 +1200
changeset 27092 fcdc12d8804e171cda0615540bdab14dbf0be64f
parent 27091 b2f3c5cf5816fbda9edceefe0ba86b0f112357c3
child 27093 42e87103b39838048895e0b64ebd92e5c861f9ab
push id16156
push usermozilla@jorgk.com
push dateTue, 09 Jul 2019 16:24:43 +0000
treeherdercomm-central@fcdc12d8804e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaenglab
bugs1564294
Bug 1564294 - Don't iterate over a live list of FileLink accounts when removing a provider. r=Paenglab
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;