Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make undefined check safe #1238

Merged
merged 1 commit into from
Aug 16, 2017
Merged

Make undefined check safe #1238

merged 1 commit into from
Aug 16, 2017

Conversation

damassi
Copy link
Member

@damassi damassi commented Aug 16, 2017

Noticed in the previous PR that there was an equality check against undefined but JS is super weird and that kind of operation isn't safe. A best practice is do typeof myVar === 'undefined', or use underscore or lodash's _.isUndefined.

@kanaabe
Copy link
Contributor

kanaabe commented Aug 16, 2017

Nice catch! Thanks

@yuki24
Copy link
Contributor

yuki24 commented Aug 16, 2017

@damassi looks great! Thanks for catching this 👍

@yuki24 yuki24 merged commit 5c53254 into artsy:master Aug 16, 2017
@damassi damassi deleted the fix-js-type branch August 16, 2017 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants