Skip to content

Prevent crash when FOOTER_SECTION.sections is undefined#263

Closed
sancheet230 wants to merge 2 commits intoaccordproject:mainfrom
sancheet230:main
Closed

Prevent crash when FOOTER_SECTION.sections is undefined#263
sancheet230 wants to merge 2 commits intoaccordproject:mainfrom
sancheet230:main

Conversation

@sancheet230
Copy link
Contributor

@sancheet230 sancheet230 commented Mar 16, 2025

Closes #262

Fixes:

  1. Used optional chaining (?.) to safely access FOOTER_SECTION.sections
  2. If sections is not available, it gracefully skips rendering the section

Changes

  1. Updated CustomFooter to use:
{FOOTER_SECTION?.sections?.map((section) => ( ... ))}
  1. Ensured the UI remains functional even if the footer JSON does not include sections

Testing

  1. Verified the footer renders properly when FOOTER_SECTION.sections is defined.
  2. Confirmed the component does not crash if FOOTER_SECTION.sections is missing or empty

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 16, 2025 10:20
@netlify
Copy link

netlify bot commented Mar 16, 2025

Deploy Preview for ap-template-playground failed.

Name Link
🔨 Latest commit c60c7a5
🔍 Latest deploy log https://app.netlify.com/sites/ap-template-playground/deploys/67dbacf129e56600086bc1fb

Signed-off-by: sancheet230 <sancheet.p24@medhaviskillsuniversity.edu.in>
@sancheet230
Copy link
Contributor Author

sancheet230 commented Mar 20, 2025

@DianaLease There are new files created in the codebase when I was working on this issue so now I have to configure the codebase again for solving this issue according to new code changes. Will raise a new PR soon

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

1 participant