fix: verify dogT exists in the context before using it#692
Merged
vearutop merged 1 commit intocucumber:mainfrom Jul 15, 2025
Merged
fix: verify dogT exists in the context before using it#692vearutop merged 1 commit intocucumber:mainfrom
vearutop merged 1 commit intocucumber:mainfrom
Conversation
getTestingT(ctx) can return a nil pointer (if there is no dogT in the context) in this case a segfault causes the whole test harness to fail. By verifying whether there is a dogT in the context, the test can continue.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #692 +/- ##
==========================================
- Coverage 83.21% 77.88% -5.33%
==========================================
Files 28 41 +13
Lines 3413 4051 +638
==========================================
+ Hits 2840 3155 +315
- Misses 458 778 +320
- Partials 115 118 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vearutop
approved these changes
Jul 15, 2025
Contributor
Author
|
Is there any release scheduled for this module? Currently we are using a fork to work around this issue but I would prefer to switch back to the main project once there is a release with this fix in it. |
Member
|
New version https://github.com/cucumber/godog/releases/tag/v0.15.1 released with this and a few other changes. Thank you for contribution! |
Contributor
Author
|
Thank you for merging it so quick and create the release! |
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.
getTestingT(ctx) can return a nil pointer (if there is no dogT in the context) in this case a segfault causes the whole test harness to fail. By verifying whether there is a dogT in the context, the test can continue.
🤔 What's changed?
Added a check to verify whether the dogT was available in the context before querying its state.
⚡️ What's your motivation?
While using godog (After updating from v0.12.x to v0.15.0) our test harness ran into a segfault. The cause of the segfault was a nil pointer deference that is verified to be fixed with the proposed change.
🏷️ What kind of change is this?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.