Xorg: Handle nil :content value
The `Xorg.find_versions` method was recently updated to replace `match_data[:content].blank?` with `match_data[:content].empty?` but this is producing an `undefined method 'empty?' for nil` error, as `:content` is not present when `PageMatch.find_versions` uses cached content. This updates `Xorg.find_versions` to handle nil `:content` values in a way that's similar to other `find_versions` methods.
This commit is contained in:
parent
1f5448fc65
commit
67c333ec0a
@ -136,9 +136,11 @@ module Homebrew
|
|||||||
options:,
|
options:,
|
||||||
&block
|
&block
|
||||||
)
|
)
|
||||||
|
content = match_data[:content]
|
||||||
|
return match_data if content.blank?
|
||||||
|
|
||||||
# Cache any new page content
|
# Cache any new page content
|
||||||
@page_data[generated_url] = match_data[:content] unless match_data[:content].empty?
|
@page_data[generated_url] = content unless cached_content
|
||||||
|
|
||||||
match_data
|
match_data
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user