Closed Bug 1139830 Opened 8 years ago Closed 8 years ago

Make type/id/payload nullable in MozNDEFRecordOptions

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
2.2 S12 (15may)
Tracking Status
firefox39 --- fixed

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

(Whiteboard: [p=1])

Attachments

(1 file)

Although smaug mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=1053732#c2 those attributes need not to be nullable.
However after Bug 1138886 I try to remove the extra creation of MozNDEFRecord in NfcContentHelper#encodeNDEFRecords, I still met 

03-05 05:23:18.917: W/GeckoConsole(4057): [JavaScript Error: "TypeError: 'id' member of MozNDEFRecordOptions is not an object." {file: "jar:file:///system/b2g/omni.ja!/components/Nfc.js" line: 521}]

The reason is when Nfc.js receives the records sent from content side, the record.id is null, but when it calls nfcService.sendCommand, the record in NfcCommandOptions is type of MozNDEFRecordOptions, with id is type of Uint8Array, so the initialization fails in coverting the nullable to Uint8Array.

So in this bug I'll make type/id/payload in MozNDEFRecordOptions nullable.
Attachment #8573768 - Flags: review?(bugs) → review+
You need to log in before you can comment on or make changes to this bug.