Closed Bug 734181 Opened 8 years ago Closed 8 years ago

[B2G] SMS database: filter with `endDate` but no `startDate` parameter throws an exception

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: ferjm, Assigned: ferjm)

Details

Attachments

(1 file)

The following test:

let filter = new MozSmsFilter();
filter.endDate = new Date(1329999861799);
gSmsDatabaseService.createMessageList(filter, false, 11);

throws this exception:

ERROR TEST-UNEXPECTED-FAIL | chrome://mochitests/content/chrome/dom/sms/tests/test_smsdatabaseservice.xul | an unexpected uncaught JS exception reported through window.onerror - uncaught exception: [Exception... "'[JavaScript Error: "filter.startDate is null" {file: "file:///Volumes/Data/dev/mozilla/mozilla-central-hg/obj-firefox/dist/Nightly.app/Contents/MacOS/components/SmsDatabaseService.js" line: 491}]' when calling method: [nsISmsDatabaseService::createMessageList]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://mochitests/content/chrome/dom/sms/tests/test_smsdatabaseservice.xul :: test_createMessageList_endDate_filter_success :: line 401"  data: yes] at :0
Attached patch Fix v1Splinter Review
Here it goes the fix.
Assignee: nobody → ferjmoreno
Attachment #604119 - Flags: review?(philipp)
Comment on attachment 604119 [details] [diff] [review]
Fix v1

Ouch... :)

Looks like you discovered this while writing tests, so I won't even ask for them. Goooo tests! :)
Attachment #604119 - Flags: review?(philipp) → review+
https://hg.mozilla.org/mozilla-central/rev/db2954a4c62f
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.