cask: handle nil URLs

This commit is contained in:
Bo Anderson 2023-02-24 18:04:18 +00:00
parent 51e0c685f8
commit c416e4bbee
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -277,8 +277,8 @@ module Cask
return api_to_local_hash(Homebrew::API.merge_variations(json_cask))
end
url_specs = url.specs.dup
case url_specs[:user_agent]
url_specs = url&.specs.dup
case url_specs&.dig(:user_agent)
when :default
url_specs.delete(:user_agent)
when Symbol