From 5cf90eb103dabaf57edc43ba88803cbe121ae2c6 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Mon, 18 Nov 2024 09:51:06 +0100 Subject: [PATCH] fix(champ): no crash when drop_down_list with other champ value_json is nil --- app/models/types_de_champ/drop_down_list_type_de_champ.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/types_de_champ/drop_down_list_type_de_champ.rb b/app/models/types_de_champ/drop_down_list_type_de_champ.rb index 039d437bb..eee0c03b8 100644 --- a/app/models/types_de_champ/drop_down_list_type_de_champ.rb +++ b/app/models/types_de_champ/drop_down_list_type_de_champ.rb @@ -12,6 +12,6 @@ class TypesDeChamp::DropDownListTypeDeChamp < TypesDeChamp::TypeDeChampBase end def champ_with_other_value?(champ) - drop_down_other? && champ.value_json['other'] + drop_down_other? && champ.value_json&.fetch('other', false) end end