Merge pull request #11888 from samford/livecheck/PageMatch#find_versions-fix-early-return-conditions

PageMatch#find_versions: Fix return conditions
This commit is contained in:
Sam Ford 2021-08-19 09:32:20 -04:00 committed by GitHub
commit 02756cfe45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,7 @@ module Homebrew
} }
def self.find_versions(url:, regex:, provided_content: nil, **_unused, &block) def self.find_versions(url:, regex:, provided_content: nil, **_unused, &block)
match_data = { matches: {}, regex: regex, url: url } match_data = { matches: {}, regex: regex, url: url }
return match_data if url.blank? || regex.blank? return match_data if url.blank? || (regex.blank? && block.blank?)
content = if provided_content.is_a?(String) content = if provided_content.is_a?(String)
match_data[:cached] = true match_data[:cached] = true