Closed Bug 959286 Opened 12 years ago Closed 12 years ago

Defaulting track event values doesn't happen if object has a property set to undefined

Categories

(Webmaker Graveyard :: Popcorn Maker, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: thecount, Assigned: thecount)

Details

Attachments

(1 file)

Right now on staging YouTube clips being opened in the editor crashes. We try to access contentType which is expected to be a string with the content type, or defaulted to "". Actually though, it's undefined, and it misses the defaulting. We check if something needs to be defaulted by doing "!popcornOptions.hasOwnProperty( prop )" This is going to fail if at some point we did this: options.contentType: getContentType() // returns undefined so now even though options,contentType is not defined, there is a contentType property there, so it never gets defaulted. We should instead be doing a double equal check against null. This way we don't default false, 0 and "", but we do default undefined, no prop and null. Patch done, just need a bug number.
Assignee: nobody → scott
Also added line comments in the pull to explain the changes. Might not be obvious.
Attachment #8359329 - Flags: review?(schranz.m) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: needinfo?(scott)
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Flags: needinfo?(scott)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: