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

Error: chomp on nil #307

Open
Taknok opened this issue Mar 15, 2022 · 0 comments
Open

Error: chomp on nil #307

Taknok opened this issue Mar 15, 2022 · 0 comments

Comments

@Taknok
Copy link

Taknok commented Mar 15, 2022

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).

skull-squadron added a commit to skull-squadron/svn2git that referenced this issue Jan 14, 2024
nirvdrum#308

The proper way to do subprocess I/O is to do less.
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