Skip to content

Error: chomp on nil #307

Open
Open
@Taknok

Description

@Taknok

What happend

The following error is sometimes returned and the tool crash:

private method 'chomp' called for nil:NilClass (NoMethodError)

Why

This is triggered by this line:

loop { @stdin_queue << $stdin.gets.chomp }

gets may return a string or nil according to the documentation: https://ruby-doc.org/core-3.1.1/Kernel.html#method-i-gets
nil does not have a chomp method and trigger the error (with a crash).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions