Skip to content

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

@bhb

Description

@bhb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions