doctor: use respond_to? instead of NoMethodError
Closes Homebrew/homebrew#47715. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
88535b09b7
commit
0472b3f340
@ -21,13 +21,13 @@ module Homebrew
|
||||
|
||||
first_warning = true
|
||||
methods.each do |method|
|
||||
begin
|
||||
out = checks.send(method)
|
||||
rescue NoMethodError
|
||||
unless checks.respond_to?(method)
|
||||
Homebrew.failed = true
|
||||
puts "No check available by the name: #{method}"
|
||||
next
|
||||
end
|
||||
|
||||
out = checks.send(method)
|
||||
unless out.nil? || out.empty?
|
||||
if first_warning
|
||||
$stderr.puts <<-EOS.undent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user