Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Avoid null error in toc controller #4506

Merged
merged 1 commit into from
Apr 20, 2024
Merged

Conversation

JoshDevHub
Copy link
Contributor

Because

Currently there's a null error that can happen in the toc stimulus controller if a lesson starts with a comment.

This PR

  • Removes the possibility for this error by using optional chaining and an early return

Issue

Closes #4434

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the keyword: brief description of change format, using one of the following keywords:
    • Feature - adds new or amends existing user-facing behavior
    • Chore - changes that have no user-facing value, refactors, dependency bumps, etc
    • Fix - bug fixes
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • I have verified all tests and linters pass after making these changes.
  • If this PR addresses an open issue, it is linked in the Issue section
  • If applicable, this PR includes new or updated automated tests

@KevinMulhern KevinMulhern temporarily deployed to odin-review-app-pr-4506 April 19, 2024 23:12 Inactive
@JoshDevHub
Copy link
Contributor Author

To QA in the review app:

  1. Visit a lesson that has a linter comment. An example would be lessons/foundations-installing-node-js
  2. Open the console and verify no null error.

@MaoShizhong MaoShizhong mentioned this pull request Apr 20, 2024
7 tasks
Copy link
Member

@KevinMulhern KevinMulhern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JoshDevHub 🚀

@KevinMulhern KevinMulhern merged commit 8f7507e into main Apr 20, 2024
3 checks passed
@KevinMulhern KevinMulhern deleted the fix_toc_null_error branch April 20, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Bug: null error in lessons with magic comments for markdownlint
2 participants