Bug 1732231 - Prevent updating the folderTree.json if the folder pane is empty or not initialized. r=mkmelin

Differential Revision: https://phabricator.services.mozilla.com/D126591

--HG--
extra : amend_source : dc6b13750a1b1b3efaf0fafbd5d9153c065be749
This commit is contained in:
Alessandro Castellani 2021-09-25 13:05:08 +03:00
Родитель e0550c4477
Коммит ed466dd124
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -220,8 +220,10 @@ var gFolderTreeView = {
// Remove our listener // Remove our listener
MailServices.mailSession.RemoveFolderListener(this); MailServices.mailSession.RemoveFolderListener(this);
if (filename) { // Update the JSON file only if we have a file, the folder tree was inited
// Write out our json file... // and we have at least one available folder in order to avoid overriding
// existing data in case the UI is broken on startup.
if (filename && this.isInited && this.rowCount) {
let data = { let data = {
open: this._persistOpenMap, open: this._persistOpenMap,
colors: this._persistColorMap, colors: this._persistColorMap,