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

when element === nil this line throws TypeError: Cannot read property 'constructor' of null #119

Closed
tevel opened this issue Apr 29, 2021 · 5 comments · Fixed by #142
Closed
Assignees
Labels

Comments

@tevel
Copy link

tevel commented Apr 29, 2021

return typeof element === 'object' && element.constructor !== Array && element != null;

Offered solution: change the order of conditions in this line.

@tevel
Copy link
Author

tevel commented Apr 29, 2021

the correct order should be:
return typeof element === 'object' && element != null && element.constructor !== Array;

@mattwelke
Copy link
Collaborator

Ah the joys of JS.

image
image

Yash-Singh1 added a commit to Yash-Singh1/schema-inspector that referenced this issue Apr 29, 2021
@Yash-Singh1 Yash-Singh1 self-assigned this Apr 29, 2021
@tevel
Copy link
Author

tevel commented May 2, 2021

the problem is it fails with TypeError: Cannot read property 'constructor' of null

@github-actions
Copy link

github-actions bot commented Jul 2, 2021

This issue is stale because it has had no activity for 60 days. It will be closed after 14 more days of no activity.

@github-actions github-actions bot added the Stale label Jul 2, 2021
@Yash-Singh1 Yash-Singh1 removed the Stale label Jul 2, 2021
@stemwinder
Copy link

Ran in to this in the upgrade from 2.0.0 to 2.0.1. Downgrading resolves the issue (for now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants