Skip to content

optional chaining (?.) to prevent the crash for footer.tsx#302

Closed
sancheet230 wants to merge 1 commit intoaccordproject:mainfrom
sancheet230:main
Closed

optional chaining (?.) to prevent the crash for footer.tsx#302
sancheet230 wants to merge 1 commit intoaccordproject:mainfrom
sancheet230:main

Conversation

@sancheet230
Copy link
Contributor

@sancheet230 sancheet230 commented Mar 20, 2025

Closes #262

The application crashes if FOOTER_SECTION.sections is undefined or null. This happens because .map() is being used without checking if sections exist

Changes

Added optional chaining (?.) to check if FOOTER_SECTION.sections exists before calling .map()

Flags

Provided a fallback message "No links available" if FOOTER_SECTION.sections is undefined or null.

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

Signed-off-by: sancheet230 <sancheet.p24@medhaviskillsuniversity.edu.in>
@sancheet230 sancheet230 requested a review from a team as a code owner March 20, 2025 06:16
@netlify
Copy link

netlify bot commented Mar 20, 2025

Deploy Preview for ap-template-playground ready!

Name Link
🔨 Latest commit 5381188
🔍 Latest deploy log https://app.netlify.com/sites/ap-template-playground/deploys/67dbb2cdb90aa80008e34f1c
😎 Deploy Preview https://deploy-preview-302--ap-template-playground.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 configuration.

@sancheet230 sancheet230 changed the title optional chaining (?.) to prevent the crash for footer.tsx optional chaining (?.) to prevent the crash for footer.tsx Mar 20, 2025
@sancheet230
Copy link
Contributor Author

sancheet230 commented Mar 20, 2025

@DianaLease @sanketshevkar That's all from my side you can review this out

@ekarademir ekarademir closed this Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Prevent Potential Crash if FOOTER_SECTION.sections is Undefined

2 participants