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

data:null in relationships produces error TypeError: Cannot read property 'id' of null #4

Closed
AndreyMirzoyan opened this issue Feb 28, 2017 · 2 comments
Assignees
Labels

Comments

@AndreyMirzoyan
Copy link

AndreyMirzoyan commented Feb 28, 2017

Normalization proudces error "TypeError: Cannot read property 'id' of null" in this example

... { "attributes": { "action": "ping", }, "id": "14", "relationships": { "ad_network": { "data": null } }, "type": "app_actions" } ...

To fix this error, please replace
if (typeof object[key].data !== 'undefined')
with
if (typeof object[key].data !== 'undefined' && object[key].data !== null) {

yury-dymov added a commit that referenced this issue Feb 28, 2017
@yury-dymov
Copy link
Owner

Hi @AndreyMirzoyan,

thank you for your feedback, please check the new version.

Kind regards,
Yury.

@yury-dymov yury-dymov self-assigned this Feb 28, 2017
@yury-dymov yury-dymov added the bug label Feb 28, 2017
@AndreyMirzoyan
Copy link
Author

Thanks! It sloves my problem

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

No branches or pull requests

2 participants