Load nil reasons from API correctly

This commit is contained in:
Rylan Polster 2023-12-04 14:11:31 -05:00
parent 40d3ab6a5d
commit c5f33aaf99
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64

View File

@ -63,8 +63,8 @@ module DeprecateDisable
end
def to_reason_string_or_symbol(string, type:)
if (type == :formula && FORMULA_DEPRECATE_DISABLE_REASONS.key?(string.to_sym)) ||
(type == :cask && CASK_DEPRECATE_DISABLE_REASONS.key?(string.to_sym))
if (type == :formula && FORMULA_DEPRECATE_DISABLE_REASONS.key?(string&.to_sym)) ||
(type == :cask && CASK_DEPRECATE_DISABLE_REASONS.key?(string&.to_sym))
return string.to_sym
end