Merge pull request #18203 from Homebrew/sponsorships-error

This commit is contained in:
Carlo Cabrera 2024-08-30 11:13:29 +08:00 committed by GitHub
commit e3d295ae12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -467,7 +467,9 @@ module GitHub
# This has been reported to GitHub. # This has been reported to GitHub.
errors += result["errors"] if result["errors"].present? errors += result["errors"] if result["errors"].present?
current_sponsorships = result["data"]["organization"]["sponsorshipsAsMaintainer"] current_sponsorships = result.dig("data", "organization", "sponsorshipsAsMaintainer")
# if `current_sponsorships` is blank, then there should be errors to report.
next { "hasNextPage" => false } if current_sponsorships.blank?
# The organisations mentioned above will show up as nil nodes. # The organisations mentioned above will show up as nil nodes.
if (nodes = current_sponsorships["nodes"].compact.presence) if (nodes = current_sponsorships["nodes"].compact.presence)