PageMatch#find_versions: Fix return conditions

This commit is contained in:
Sam Ford 2021-08-19 09:01:11 -04:00
parent 45fdecce38
commit b4adf2a42e
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE

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