From 926c5b739aa169ddce31bf2fd86884421196ac52 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sun, 7 Jan 2024 15:45:24 -0800 Subject: [PATCH] cmd/audit: fix type error in cask livecheck url audit This got updated recently in 42a42c96acc5193dbb6e321ff2aaecceb00e48a4 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. --- Library/Homebrew/cask/audit.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 73b236644bc9d..85f6df62f31a5 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -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