Closed AndreyMirzoyan closed 7 years ago
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) {
if (typeof object[key].data !== 'undefined')
if (typeof object[key].data !== 'undefined' && object[key].data !== null) {
Hi @AndreyMirzoyan,
thank you for your feedback, please check the new version.
Kind regards, Yury.
Thanks! It sloves my problem
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')
withif (typeof object[key].data !== 'undefined' && object[key].data !== null) {