diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 57499f2e3b..8ec0339f4d 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -502,5 +502,7 @@ def command_help_lines(path) end def redact_secrets(input, secrets) - secrets.reduce(input) { |str, secret| str.gsub secret, "******" }.freeze + secrets.compact + .reduce(input) { |str, secret| str.gsub secret, "******" } + .freeze end