Skip to content

Fix bug in PACKAGE.md examples#7561

Merged
tarekgh merged 2 commits intodotnet:mainfrom
adamsitnik:patch-1
Dec 1, 2025
Merged

Fix bug in PACKAGE.md examples#7561
tarekgh merged 2 commits intodotnet:mainfrom
adamsitnik:patch-1

Conversation

@adamsitnik
Copy link
Member

I tried to use the code from the README.md to prepare for a demo I am doing tomorrow and I got NRE. We should be using source rather than processedText and I think it's better to rename processedText to normalizedText to express what it is.

cc @luisquintanilla @tarekgh

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a null reference exception (NRE) bug in the PACKAGE.md code examples. The examples were attempting to call .Substring() on a potentially null processedText variable. The fix updates the code to use the original source string for substring operations and renames the variable to normalizedText to better reflect its purpose.

Key Changes:

  • Fixed NRE by using source instead of normalizedText in .Substring() calls
  • Renamed processedText to normalizedText for better clarity and API consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

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

Thanks @adamsitnik for fixing this!

@tarekgh tarekgh merged commit d021488 into dotnet:main Dec 1, 2025
3 of 4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants