Skip to content

Conversation

@Azzurra88
Copy link

Adds null check when match returns no results, preventing TypeError in docs generation.

@Azzurra88 Azzurra88 requested a review from a team as a code owner January 27, 2026 15:30
@changeset-bot
Copy link

changeset-bot bot commented Jan 27, 2026

⚠️ No Changeset found

Latest commit: a3d586d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

The change modifies docs/templates/helpers.js in the with-prelude function to add null-safety handling. Previously, the code assumed contents.match() would always return an array. The updated code now uses a null coalescing pattern (contents.match(...) || []) to provide a fallback empty array when the match operation returns null. This prevents potential errors when processing cases where no matches are found. The rest of the function logic remains unchanged.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(docs): prevent null error in helpers' clearly and specifically describes the main change: adding a null check to prevent errors in the helpers file.
Description check ✅ Passed The description 'Adds null check when match returns no results, preventing TypeError in docs generation' directly relates to and accurately describes the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant