Closed
Bug 1322838
Opened 8 years ago
Closed 7 years ago
selectedDir is null in chrome://messenger/content/addressbook/abCommon.js
Categories
(Thunderbird :: Address Book, defect)
Thunderbird
Address Book
Tracking
(thunderbird52 fixed, thunderbird53 fixed)
RESOLVED
FIXED
Thunderbird 53.0
People
(Reporter: aceman, Assigned: jorgk-bmo)
References
Details
Attachments
(1 file, 2 obsolete files)
3.92 KB,
patch
|
aceman
:
review+
jorgk-bmo
:
approval-comm-aurora+
|
Details | Diff | Splinter Review |
Can be seen in all test runs: 20:01:03 INFO - TEST-START | C:\slave\test\build\tests\mozmill\addrbook\test-update-mailing-list.js | test_contact_in_mailing_list_updated 20:01:03 INFO - JavaScript error: chrome://messenger/content/addressbook/abCommon.js, line 69: TypeError: selectedDir is null 20:01:03 INFO - JavaScript error: chrome://messenger/content/addressbook/abCommon.js, line 69: TypeError: selectedDir is null 20:01:03 INFO - JavaScript error: chrome://messenger/content/addressbook/abCommon.js, line 69: TypeError: selectedDir is null 20:01:03 INFO - JavaScript error: chrome://messenger/content/addressbook/abCommon.js, line 69: TypeError: selectedDir is null Caused in bug 1319409. selectedDir.URI is called before selectedDir is checked for null, that is done later in the code. Please check the Seamonkey version too.
Comment 1•8 years ago
|
||
Thanks. The code below is obviously wrong, because if we're testing for selectedDir == null, we must do that before getting selectedDir.URI. Which is nice because it simplifies the code even more. But I suspect the test code is also wrong: There's no way in the directory tree UI to NOT have a selected directory. Un-selecting a directory is not possible. So how does test code arrive at a scenario without a selected directory? Can you file a link to the test code? case "button_delete": { let selectedDir = getSelectedDirectory(); let selectedDirURI = selectedDir.URI; // Context-sensitive labels for Edit > Delete menuitem. if (command == "cmd_delete" && selectedDir) { goSetMenuValue(command, selectedDir.isMailList ? "valueList" : "valueAddressBook"); } // If there's no directory selected, or if it's one of these special ABs, // return false to disable deletion. if (!selectedDir || (selectedDirURI == kPersonalAddressbookURI) || (selectedDirURI == kCollectedAddressbookURI)) return false;
Assignee | ||
Comment 2•8 years ago
|
||
Untested ;-) Let's not waste too many cycles with this obvious problem.
Assignee | ||
Comment 3•8 years ago
|
||
Aceman told me on IRC that I need to |return false;|, so here we go.
Attachment #8817861 -
Attachment is obsolete: true
Attachment #8817861 -
Flags: review?(acelists)
Attachment #8817922 -
Flags: review?(acelists)
Assignee | ||
Comment 5•8 years ago
|
||
Sure, but that doesn't affect the correctness of the patch ;-)
That is not so sure. Unless we want to make a new bug if anything needs to be done in addition.
Comment on attachment 8817922 [details] [diff] [review] 1322838-sel-dir-check.patch (v1b). Review of attachment 8817922 [details] [diff] [review]: ----------------------------------------------------------------- OK, the error is not easily reproducible on Linux. But I've looked at the test and it does delete the currently selected AB which may trigger the error. I could also reproduce it manually. Also creating new AB in the AB window triggers the error. It may be that for a moment when the AB tree is rebuilt or modified, that there is temporarily no selection. The patch fixes these cases so I do not see anything more that would need to be done here.
Attachment #8817922 -
Flags: review?(acelists) → review+
Assignee | ||
Comment 8•7 years ago
|
||
(In reply to :aceman from comment #7) > The patch fixes these cases so I do not see anything more that would need to > be done here. Sigh, I do. Fix the suite/ part. We landed the same stuff that doesn't work on suite/ I'll do the same change in suite/. Do you want to see it again? So much for Thomas' "risk free" patch. I'm glad I didn't uplift that.
Assignee | ||
Comment 9•7 years ago
|
||
You can stick r+ onto it again.
Attachment #8817922 -
Attachment is obsolete: true
Attachment #8818695 -
Flags: review?(acelists)
Reporter | ||
Comment 10•7 years ago
|
||
Comment on attachment 8818695 [details] [diff] [review] 1322838-sel-dir-check.patch (v1b) + suite/ Review of attachment 8818695 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, looks fine. ::: suite/mailnews/addrbook/abCommon.js @@ +64,5 @@ > goSetMenuValue(command, selectedDir.isMailList ? > "valueList" : "valueAddressBook"); > } > > // If there's no directory selected, or if it's one of these special ABs, You didn't update the comment in the way you did for TB.
Attachment #8818695 -
Flags: review?(acelists) → review+
Assignee | ||
Comment 11•7 years ago
|
||
I will.
Assignee | ||
Comment 12•7 years ago
|
||
https://hg.mozilla.org/comm-central/rev/d91cb69a8e99e16a10a54167652fb9d95527f676 Landed with the comment in the suite/ part fixed.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 53.0
Assignee | ||
Comment 13•7 years ago
|
||
Aurora (TB 52): https://hg.mozilla.org/releases/comm-aurora/rev/06d0c74bf867ad62fc6c50f4e5724544522013bf (regressing bug) https://hg.mozilla.org/releases/comm-aurora/rev/1e40d7501405429e0f88adefc3d096c59464dc56 (this bug) This needed uplift since the regressing bug was uplifted, see bug 1319409 comment #60.
status-thunderbird52:
--- → fixed
status-thunderbird53:
--- → fixed
Assignee | ||
Updated•7 years ago
|
Attachment #8818695 -
Flags: approval-comm-aurora+
You need to log in
before you can comment on or make changes to this bug.
Description
•