Skip to content

Commit

Permalink
cmd/audit: fix type error in cask livecheck url audit
Browse files Browse the repository at this point in the history
This got updated recently in 42a42c9
to split out the livecheck audits and as a result of that the type
signature for the #validate_url_for_https_availablity method got updated.

This did not account for the possibility that the livecheck url was nil.
I've added a nil check here since it makes no sense to try and validate
a nil url and we have nil checks for the other two http availability
audits already. Plus, the livecheck blocks are audited thoroughly already
for syntax.
  • Loading branch information
apainintheneck committed Jan 7, 2024
1 parent 42a42c9 commit 926c5b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Library/Homebrew/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -806,10 +806,11 @@ def audit_url_https_availability
def audit_livecheck_https_availability
return unless online?
return unless cask.livecheckable?
return if cask.livecheck.url.is_a?(Symbol)
return unless (url = cask.livecheck.url)
return if url.is_a?(Symbol)

validate_url_for_https_availability(
cask.livecheck.url, "livecheck URL",
url, "livecheck URL",
check_content: true
)
end
Expand Down

0 comments on commit 926c5b7

Please sign in to comment.