formula_installer: fix forbidden license check

Convert forbidden licenses to a string before duplicating to have empty
strings instead of `nil`.
This commit is contained in:
Rylan Polster 2020-10-22 15:15:56 -04:00
parent b06bcf3db1
commit 42d75c2787

View File

@ -1139,7 +1139,7 @@ class FormulaInstaller
end
def forbidden_license_check
forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.dup
forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.to_s.dup
SPDX::ALLOWED_LICENSE_SYMBOLS.each do |s|
pattern = /#{s.to_s.tr("_", " ")}/i
forbidden_licenses.sub!(pattern, s.to_s)