patternfly / patternfly-quickstarts

Repository containing the PatternFly Quick Start extension code
MIT License
15 stars 39 forks source link

Conditionally access activeHelpTopic links array. #162

Closed Hyperkid123 closed 2 years ago

Hyperkid123 commented 2 years ago

If the content does not define the links array, the UI will cause a crash due to an unexpected map call.

Uncaught TypeError: Cannot read properties of undefined (reading 'map')
    at HelpTopicPanelContent (index.es.js:2358:1)
    at renderWithHooks (react-dom.development.js:14985:1)
    at updateFunctionComponent (react-dom.development.js:17356:1)
    at beginWork (react-dom.development.js:19063:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at beginWork$1 (react-dom.development.js:23964:1)
    at performUnitOfWork (react-dom.development.js:22776:1)
    at workLoopSync (react-dom.development.js:22707:1)
{activeHelpTopic?.links.map(({ href, text, newTab, isExternal }) => {

cc @CooperRedhat @jschuler More details in slack conversation. Can we get this released ASAP, please?

netlify[bot] commented 2 years ago

Deploy Preview for quickstarts ready!

Name Link
Latest commit e5e8858c3e8ec6d31dddd165c34cdc3f080156e3
Latest deploy log https://app.netlify.com/sites/quickstarts/deploys/62610f21ec51f500089c6f07
Deploy Preview https://deploy-preview-162--quickstarts.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.