Skip to content

Commit

Permalink
Add a missing nil check around cname_to_domain_to_pages?
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannchaudet committed Sep 17, 2024
1 parent f44d1b8 commit 07ec091
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/github-pages-health-check/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def cname_to_github_user_domain?
# Check if the CNAME points to a Domain that points to pages
# e.g. CNAME -> Domain -> Pages
def cname_to_domain_to_pages?
return false unless dns?
a_record_to_pages = dns.select { |d| d.type == Dnsruby::Types::A && d.name.to_s == host }.first

return false unless a_record_to_pages && cname? && !cname_to_pages_dot_github_dot_com? && @www_cname
Expand Down

0 comments on commit 07ec091

Please sign in to comment.