Skip to content
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

When pattern is nil, enhance_with_matching_rule will not fail #182

Merged
merged 1 commit into from
Jul 1, 2017

Conversation

lzap
Copy link
Contributor

@lzap lzap commented Dec 23, 2016

This fixes the

NoMethodError: undefined method `match' for nil:NilClass

error with gettext/gettext_i18n_rails.

ManageIQ/manageiq#4774

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Only patterns that are present can match a rule name. This fix makes sense.

I get curious though: Why was that @rules element nil in its first position?

@lzap
Copy link
Contributor Author

lzap commented Jan 2, 2017

I put an inspect and it's full of nils strangely: [[nil, [], [], nil], [nil, [], [], nil], [nil, [], [], nil], [nil, [], [], nil], [nil, [], [], nil], [nil, [], [], nil]]

@hsbt hsbt self-requested a review January 6, 2017 03:56
Copy link
Member

@hsbt hsbt left a comment

Choose a reason for hiding this comment

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

Can you add new test about this change?

@hsbt hsbt merged commit 9341b11 into ruby:master Jul 1, 2017
hsbt added a commit that referenced this pull request Jul 1, 2017
hsbt added a commit that referenced this pull request Jul 1, 2017
@lzap lzap deleted the rake-enhance-nil branch July 12, 2017 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants