Skip to content

[Gherkin] Fix NPE on empty table #1913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2020
Merged

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Mar 4, 2020

Parsing the feature below results in an NPE because Gherkin v5 uses the location
of the first cell as the location of the table. Because there is no cell, there
is no location. In this case we fall back to using the line of the step + 1.

Feature: Empty table

  Scenario: This is valid Gherkin
    Given an empty list
      |

Fixes: #1912

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Parsing the feature below results in an NPE because Gherkin v5 uses the location
of the first cell as the location of the table. Because there is no cell, there
is no location. In this case we fall back to using the line of the step + 1.

```
Feature: Empty table

  Scenario: This is valid Gherkin
    Given an empty list
      |
```
@coveralls
Copy link

Coverage Status

Coverage increased (+2.5%) to 85.528% when pulling 8ec0725 on gherkin-fix-npe-on-empty-table into 4d98e02 on master.

@mpkorstanje mpkorstanje merged commit caec39f into master Mar 5, 2020
@mpkorstanje mpkorstanje deleted the gherkin-fix-npe-on-empty-table branch March 5, 2020 13:16
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.

Error when passing empty table to step
2 participants