Skip to content

bugfix: crash when Cucumber::Messages::Group#children is nil - #1819

Merged
luke-hill merged 1 commit into
cucumber:mainfrom
vizv:bugfix-fix-map-on-nil-chilren
Feb 2, 2026
Merged

bugfix: crash when Cucumber::Messages::Group#children is nil#1819
luke-hill merged 1 commit into
cucumber:mainfrom
vizv:bugfix-fix-map-on-nil-chilren

Conversation

@vizv

@vizv vizv commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Description

This change fixes the undefined method 'map' for nil (NoMethodError) for cucumber-10.2.0/lib/cucumber/formatter/message_builder.rb:144: 'Cucumber::Formatter::MessageBuilder#argument_group_to_message' caused by:

The fix is simply accept the nil value for Cucumber::Messages::Group#children.

Alternative fix

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.

  • Tests have been added for any changes to behaviour of the code
  • New and existing tests are passing locally and on CI
  • bundle exec rubocop reports no offenses
  • RDoc comments have been updated
  • CHANGELOG.md has been updated

@luke-hill luke-hill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep can see this. It's not really a problem because it was a breaking change that was pulled in without me considering the why

@luke-hill

Copy link
Copy Markdown
Contributor

I'm not sure why I made this change in advance, given it's not needed. For now a downgrade of the expressions library will suffice.

Currently the main branch is quite murky and fixing this will take away from the effort needed to get main back to health. I'm focusing on the new v11 features.

Can you write a changelog message, it will be in the v11 release for certain

@vizv
vizv force-pushed the bugfix-fix-map-on-nil-chilren branch from c2663ce to 9f43ea1 Compare January 30, 2026 03:22
@vizv

vizv commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

I already wrote the changelog, just forgot to push 😂

Comment thread CHANGELOG.md Outdated
This change fixes the `undefined method 'map' for nil (NoMethodError)`
for `cucumber-10.2.0/lib/cucumber/formatter/message_builder.rb:144`:
`'Cucumber::Formatter::MessageBuilder#argument_group_to_message'`
caused by:

* Dec 11, 2025: cucumber#1805
  allows to pull `cucumber-cucumber-expressions` `19.0.0`

* Jan 21, 2026: cucumber/messages#370
  introduce a breaking change that allows the `children` field of
  `Cucumber::Messages::Group` to be `nil`

* Jan 21, 2026: cucumber/cucumber-expressions#387
  `ruby/lib/cucumber/cucumber_expressions/group_builder.rb` sets
  the `children` to `nil` if `empty?`

* Jan 26, 2026: The `cucumber-cucumber-expressions` `19.0.0` gem released
  and will be pulled in by `cucumber` `10.2.0` that raises the error

The fix is simply accept the `nil` value for
`Cucumber::Messages::Group#children`.
@vizv
vizv force-pushed the bugfix-fix-map-on-nil-chilren branch from 9f43ea1 to 06928ae Compare January 31, 2026 10:03
@luke-hill
luke-hill merged commit 6e746c9 into cucumber:main Feb 2, 2026
@luke-hill

Copy link
Copy Markdown
Contributor

Thankyou for this fix

@vizv
vizv deleted the bugfix-fix-map-on-nil-chilren branch February 2, 2026 10:14
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.

2 participants