Closed
Bug 997075
Opened 11 years ago
Closed 11 years ago
NFC: a is undefined in nfc_util.js line 208
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(blocking-b2g:2.0+, b2g-v2.0 fixed)
| Tracking | Status | |
|---|---|---|
| b2g-v2.0 | --- | fixed |
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
(Whiteboard: [p=1])
Attachments
(1 file)
This is found out by QA, but without debug enabled, so only error log is captured.
E/GeckoConsole( 177): [JavaScript Error: "a is undefined" {file: "app://system.gaiamobile.org/shared/js/nfc_utils.js" line: 208}]
E/GeckoConsole( 177): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: [JavaScript Error: "a is undefined" {file: "app://system.gaiamobile.org/shared/js/nfc_utils.js" line: 208}]'[JavaScript Error: "a is undefined" {file: "app://system.gaiamobile.org/shared/js/nfc_utils.js" line: 208}]' when calling method: [nsIDOMSystemMessageCallback::handleMessage]" {file: "null" line: 0}]
Comment 1•11 years ago
|
||
Reproduction steps/scenario would be useful, even if no debug. It was probably actually passed a undefined value as stated...
| Assignee | ||
Comment 2•11 years ago
|
||
But even without the log we should ask ourself:
What should the function return when the argument is undefined or null?
Comment 3•11 years ago
|
||
Sure, return null, or a throw to the caller. Why an undefined is an argument to a utility function is a good question to answer too.
Comment 4•11 years ago
|
||
We can not expect the caller would be careful to use utility functions, I wonder if we could have some methods to tell caller there are something wrong. Or this error is already enough.
Alison, do you have reproduction steps or scenarios? Thanks.
Flags: needinfo?(ashiue)
| Assignee | ||
Comment 5•11 years ago
|
||
It's easy to add
if (!a) {
return null;
}
to that function,
and it's fairly easy to find out the many callers to use NfcUtils.toUTF8(record.type);
in which type could be null from NDEF spec.
Assignee: nobody → allstars.chh
Flags: needinfo?(ashiue)
| Assignee | ||
Comment 6•11 years ago
|
||
Attachment #8409551 -
Flags: review?(alive)
Updated•11 years ago
|
blocking-b2g: --- → 2.0?
| Assignee | ||
Updated•11 years ago
|
Whiteboard: [p=1]
Target Milestone: --- → 1.4 S6 (25apr)
Updated•11 years ago
|
blocking-b2g: 2.0? → 2.0+
Updated•11 years ago
|
Attachment #8409551 -
Flags: review?(alive) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
status-b2g-v2.0:
--- → fixed
Target Milestone: 1.4 S6 (25apr) → 2.0 S1 (9may)
You need to log in
before you can comment on or make changes to this bug.
Description
•