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

TypeError: nil can't be coerced into Integer #25

Open
bhb opened this issue Feb 19, 2021 · 0 comments
Open

TypeError: nil can't be coerced into Integer #25

bhb opened this issue Feb 19, 2021 · 0 comments

Comments

@bhb
Copy link

bhb commented Feb 19, 2021

Apologies, I don't have a minimal repro for this bug, but in version 0.1.1, I occasionally get the error

TypeError: nil can't be coerced into Integer from this line:

prev_line.zip(current_line).map { |values| values[0] == values[1] ? nil : (values[1] - values[0]) }

The issue is that values[1] can be nil in some cases.

I changed that line to values[0] == values[1] ? nil : (values[1].to_i - values[0]) and it avoids the crash, although I'm not sure if that causes incorrect reporting.

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

No branches or pull requests

1 participant