Closed Bug 747362 Opened 12 years ago Closed 12 years ago

No account selected when opening the account settings dialog while the inbox of the unified view is selected

Categories

(Thunderbird :: Account Manager, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 14.0

People

(Reporter: florian, Assigned: florian)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
I see this in the error console when this happens:
JavaScript error: chrome://messenger/content/AccountManager.js, line 176: childrenNode.childNodes[i]._account is undefined


I was afraid this was caused by some of my changes for bug 742238 so I investigated. The problem is that when the 'Inbox' of the unified view is selected, the code opening the Account Settings… dialog wants to select a "Unified folders" account that isn't in the list, so the code looking for this account iterates through the whole list of accounts and fails on the "Outgoing Server (SMTP)" tree item that doesn't have an _account property.

The attached patch prevents the code from failing on tree items that don't have the _account property and to fall back to the first account when the requested account isn't in the list.
Attachment #616952 - Flags: review?(dbienvenu)
I can confirm the error. I like the patch.
But as you "document.getElementById("account-tree-children")" twice in the common path, wouldn't it be better to:
var childrenNode = document.getElementById("account-tree-children");
var accountNode = childrenNode.firstChild;

(I have seen cases where even "document.getElementById("account-tree-children") is null" (when playing with edge cases in bug 723277 comment 44), but this patch does not make that worse, I think. I'll look at that in other bug.)
Attached patch Patch v2Splinter Review
Updated patch taking into account the suggestion from comment 1.

(In reply to :aceman from comment #1)

> (I have seen cases where even
> "document.getElementById("account-tree-children") is null" (when playing
> with edge cases in bug 723277 comment 44), but this patch does not make that
> worse, I think.

It seems you meant bug 713277 comment 44.
Attachment #616952 - Attachment is obsolete: true
Attachment #616952 - Flags: review?(dbienvenu)
Attachment #616962 - Flags: review?(dbienvenu)
(In reply to Florian Quèze from comment #2)
> It seems you meant bug 713277 comment 44.
Yes, sorry.
Comment on attachment 616962 [details] [diff] [review]
Patch v2

looks reasonable, though I'd prefer let for the local vars, thx!
Attachment #616962 - Flags: review?(dbienvenu) → review+
http://hg.mozilla.org/comm-central/rev/9bb214321f4c
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 14.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: