fix: Handle null bullet point detection in update-changelog script#125
Merged
fix: Handle null bullet point detection in update-changelog script#125
Conversation
The script was failing when trying to detect bullet point characters in changelogs that contained no existing bullet points. This occurred because the Where-Object filter returned null, and calling .Trim() on null caused a "You cannot call a method on a null-valued expression" error. Fixed by wrapping the variable in quotes to convert null to empty string before calling .Trim(), which effectively defaults to using "-" as the bullet point character. Added test case for this scenario to prevent regression. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
@sentry review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update-changelog.ps1when no existing bullet points are found in the changelogProblem
The script was failing with "You cannot call a method on a null-valued expression" when trying to detect what bullet point character to use in changelogs that contained no existing bullet points. This occurred in the
sentry-playstationrepository update workflow.Solution
Changed line 183 from:
to:
By wrapping
$bulletPointin quotes, we convert null values to empty strings before calling.Trim(), which effectively defaults to using "-" as the bullet point character.Test Plan
no-bullet-pointsthat reproduces the scenario🤖 Generated with Claude Code