From 45cf26e855be513da9561e221a50ad6827843ce5 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Fri, 22 Sep 2017 12:38:37 +0200 Subject: [PATCH] If type de champ has no dropdownlist do not crash, (sentry issue: https://sentry.apientreprise.fr/apientreprise/tps_dev/issues/1833/) --- .../dossiers/champs/_drop_down_list.html.haml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/new_gestionnaire/dossiers/champs/_drop_down_list.html.haml b/app/views/new_gestionnaire/dossiers/champs/_drop_down_list.html.haml index c629a8cc8..ee46b4b26 100644 --- a/app/views/new_gestionnaire/dossiers/champs/_drop_down_list.html.haml +++ b/app/views/new_gestionnaire/dossiers/champs/_drop_down_list.html.haml @@ -1,6 +1,7 @@ = render partial: 'new_gestionnaire/dossiers/champs/champ_label', locals: { form: form, champ: champ } -= form.select :value, - champ.drop_down_list.options, - disabled: champ.drop_down_list.disabled_options, - required: champ.mandatory +- if champ.drop_down_list && champ.drop_down_list.options.any? + = form.select :value, + champ.drop_down_list.options, + disabled: champ.drop_down_list.disabled_options, + required: champ.mandatory