From 15beeeba2155c4ec486bc0504522a51757c236fa Mon Sep 17 00:00:00 2001 From: Barry Gordon Date: Thu, 13 Jul 2023 11:31:37 +0100 Subject: [PATCH] Avoid nil dependency_groups --- updater/lib/dependabot/job.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/updater/lib/dependabot/job.rb b/updater/lib/dependabot/job.rb index d2a375974c3..4e8e0df899f 100644 --- a/updater/lib/dependabot/job.rb +++ b/updater/lib/dependabot/job.rb @@ -111,7 +111,12 @@ def initialize(attributes) @update_subdependencies = attributes.fetch(:update_subdependencies) @updating_a_pull_request = attributes.fetch(:updating_a_pull_request) @vendor_dependencies = attributes.fetch(:vendor_dependencies, false) - @dependency_groups = attributes.fetch(:dependency_groups, []) + # TODO: Make this hash required + # + # We will need to do a pass updating the CLI and smoke tests before this is possible, + # so let's consider it optional for now. If we get a nil value, let's force it to be + # an array. + @dependency_groups = attributes.fetch(:dependency_groups, []) || [] @dependency_group_to_refresh = attributes.fetch(:dependency_group_to_refresh, nil) @repo_private = attributes.fetch(:repo_private, nil)