Skip to content

[.NET] Support calling Methods in GherkinLine on default value#503

Merged
mpkorstanje merged 1 commit intocucumber:mainfrom
obligaron:fix/gherkinlineinit
Nov 25, 2025
Merged

[.NET] Support calling Methods in GherkinLine on default value#503
mpkorstanje merged 1 commit intocucumber:mainfrom
obligaron:fix/gherkinlineinit

Conversation

@obligaron
Copy link
Copy Markdown
Contributor

🤔 What's changed?

GherkinLine uses a default (empty) string instead of null if constructed with a default value. This prevents a NullReferenceException when calling some methods on GherkinLine.

⚡️ What's your motivation?

Fixes #374

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@mpkorstanje
Copy link
Copy Markdown
Contributor

If not reviewed within two weeks. Please request a review from me.

Copy link
Copy Markdown
Member

@gasparnagy gasparnagy left a comment

Choose a reason for hiding this comment

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

LGTM

@mpkorstanje mpkorstanje merged commit 867f94f into cucumber:main Nov 25, 2025
2 checks passed
@obligaron obligaron deleted the fix/gherkinlineinit branch November 25, 2025 16:18
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.

[DotNet] GherkinLine throws NullReferenceException when GetLineText is called on default value

3 participants