Skip to content

use lodash to check types in resolver.js #482

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

Merged

Conversation

ponelat
Copy link
Contributor

@ponelat ponelat commented Jun 9, 2015

fixes swagger-api/swagger-ui#1349
The issue was, when 'required: null' we had a stack overflow.
The problem was in how we checked for objects.... javascript has this delightful way of classifying null as an object.

typeof null === 'object' // Thanks javascript

Which is why we often see

if(something && typeof something === 'object') { ... } // first make sure it isn't null

I've scanned the source, and replaced instances of typeof something === 'object' to _.isObject(someting).

@ponelat ponelat mentioned this pull request Jun 29, 2015
@fehguy fehguy merged commit 9894ca3 into swagger-api:develop_2.0 Jul 23, 2015
@webron webron added this to the v2.1.2 milestone Jul 31, 2015
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