From 67c333ec0ad0cf0bf0db78f3ccc6424197d4aa64 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Thu, 6 Mar 2025 09:56:01 -0500 Subject: [PATCH] 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. --- Library/Homebrew/livecheck/strategy/xorg.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/livecheck/strategy/xorg.rb b/Library/Homebrew/livecheck/strategy/xorg.rb index d62233a69a..8a7483ee1f 100644 --- a/Library/Homebrew/livecheck/strategy/xorg.rb +++ b/Library/Homebrew/livecheck/strategy/xorg.rb @@ -136,9 +136,11 @@ module Homebrew options:, &block ) + content = match_data[:content] + return match_data if content.blank? # 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 end