Address Book search returns no results if an record contains a null value
Categories
(MailNews Core :: Address Book, defect)
Tracking
(thunderbird91 fixed)
Tracking | Status | |
---|---|---|
thunderbird91 | --- | fixed |
People
(Reporter: samantham, Assigned: samantham)
References
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
rjl
:
approval-comm-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0
Steps to reproduce:
I add a CardDAV address book. Then I go to the Address Book of Thunderbird. All the emails appear listed. I select the CardDAV address book, then enter text into the search form and press enter.
Actual results:
Empty results, or blank entries are returned.
Error shows up in Developer Tools which says:
JavaScript error: resource:///modules/AddrBookDirectory.jsm, line 307: TypeError: can't access property "toLowerCase", properties.get(...) is null
JavaScript error: chrome://messenger/content/addressbook/abView.js, line 23: NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: [JavaScript Error: "can't access property "toLowerCase", properties.get(...) is null" {file: "resource:///modules/AddrBookDirectory.jsm" line: 307}]'
[JavaScript Error: "can't access property "toLowerCase", properties.get(...) is null" {file: "resource:///modules/AddrBookDirectory.jsm" line: 307}]' when calling method: [nsIAbDirectory::search]
If I print out the property
value, I get the following (note the null value for FirstName).
{ DisplayName → "Last, First", _vCard → "BEGIN:VCARD\r\nVERSION:3.0\r\nN:First;Last,;;;\r\nFN:Last, First\r\nEMAIL;TYPE=INTERNET;TYPE=OTHER:email@email.com\r\nUID:${UID}\r\nEND:VCARD\rNULL\n", PopularityIndex → "0", PrimaryEmail → "email@email.com", _etag → ""${etag}"", FirstName → null, LastName → "First", PreferMailFormat → "0", LastModifiedDate → "0", _href → "/addressbooks/samantham/default/${UID}.vcf" }
Expected results:
The correct results appear.
Assignee | ||
Comment 1•3 years ago
|
||
Without this check, an exception occurs if the value we try and match is null.
Change it so we have the same behavior as if the key did not exist.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
N:First;Last,;;;
That's interesting. We parse this badly because of the comma. It's probably not supposed to be there according to the VCard spec, but we should handle it better than we do.
I'm going to have a closer look into this before approving your patch, which is probably fine but I want to know exactly how we get a null value stored in the first place.
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/24234fc0a9aa
Check AddressBook value isn't falsy before comparing r=darktrojan
Comment 4•3 years ago
|
||
Patch landed. First one, I believe? Well done, and thanks.
Comment 5•3 years ago
|
||
Comment on attachment 9232619 [details]
Bug 1721807 - Check AddressBook value isn't falsy before comparing r=darktrojan
[Triage Comment]
Taking for 91b4
Comment 6•3 years ago
|
||
bugherder uplift |
Thunderbird 91.0b4:
https://hg.mozilla.org/releases/comm-beta/rev/55455a53694a
Description
•