Skip to content

Commit 3de015a

Browse files
committed
fix: undefined method closed? for nil
When Errno::EMFILE Too many open files hit, IO.pipe cannot return descriptors, check that it's not nil before closing.
1 parent ad2e46f commit 3de015a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ferrum/browser/process.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def ws_url=(url)
178178

179179
def close_io(*ios)
180180
ios.each do |io|
181-
io.close unless io.closed?
181+
io.close if io && !io.closed?
182182
rescue IOError
183183
raise unless RUBY_ENGINE == "jruby"
184184
end

0 commit comments

Comments
 (0)