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

level_tokens[0] can be nil if there is no params in the top level block #682

Merged
merged 2 commits into from Mar 29, 2017

Conversation

rodjek
Copy link
Owner

@rodjek rodjek commented Mar 29, 2017

Handle the case where a { } block can exist that has no => in it, but blocks inside that block do (basically only for case statements). level_tokens gets initialised when the first => is encountered in the block.

This PR fixes this behaviour by checking if level_tokens[n] is nil and defaulting it to an empty array. Additionally, the behaviour of PuppetLint::Data#resource_indexes was inadvertently changed when I missed a call to type which resulted in comparing a PuppetLint::Lexer::Token object to a symbol.

Fixes #681

@rodjek rodjek merged commit a21de11 into master Mar 29, 2017
@rodjek rodjek deleted the issue-681 branch March 29, 2017 09:34
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.

"undefined method `map' for nil:NilClass" when running check_whitespace
1 participant