smooth-code / smooth.js

Code driven CMS powered by GraphQL & React.
MIT License
26 stars 10 forks source link

fix: add check if rel in hreflanglink is null #51

Closed tthsympa closed 4 years ago

tthsympa commented 4 years ago

If a hreflanglink has it's field rel set to null, the page crash with an react-helmet error.

The react-helmet error:

"TypeError: Cannot read property 'toLowerCase' of null
    at /usr/src/app/node_modules/react-helmet/lib/Helmet.js:246:264
    at Array.filter (<anonymous>)
    at /usr/src/app/node_modules/react-helmet/lib/Helmet.js:238:22
    at Array.reduce (<anonymous>)
    at getTagsFromPropsList (/usr/src/app/node_modules/react-helmet/lib/Helmet.js:235:18)
    at reducePropsToState (/usr/src/app/node_modules/react-helmet/lib/Helmet.js:311:19)
    at emitChange (/usr/src/app/node_modules/react-side-effect/lib/index.js:56:15)
    at SideEffect.UNSAFE_componentWillMount (/usr/src/app/node_modules/react-side-effect/lib/index.js:97:9)
    at d (/usr/src/app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:37:457)
    at $a (/usr/src/app/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:39:16)"
gregberge commented 4 years ago

Thanks!