From 412c6affc247f8dc83562a0a0262b51db6705c46 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 12 May 2023 21:26:50 +0200 Subject: [PATCH] fix(after_party): do not crash if missing champs for dossier --- lib/tasks/deployment/20230512155606_fix_champs_after_merge.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/deployment/20230512155606_fix_champs_after_merge.rake b/lib/tasks/deployment/20230512155606_fix_champs_after_merge.rake index 17ec231b7..15b7f4ae9 100644 --- a/lib/tasks/deployment/20230512155606_fix_champs_after_merge.rake +++ b/lib/tasks/deployment/20230512155606_fix_champs_after_merge.rake @@ -12,7 +12,7 @@ namespace :after_party do .group_by(&:first).transform_values { _1.map(&:second) } bad_dossiers = dossiers.filter do |(id, revision_id)| - champs_by_dossier_id[id].any? do |type_de_champ_id| + (champs_by_dossier_id[id] || []).any? do |type_de_champ_id| revision_ids = revisions_by_type_de_champ_id[type_de_champ_id] || [] !revision_id.in?(revision_ids) end