Merge pull request #6063 from tchak/fix-preview
Prevent crash in preview where there is no siblings
This commit is contained in:
commit
8c5c360c4d
2 changed files with 2 additions and 2 deletions
|
@ -88,7 +88,7 @@ class Champ < ApplicationRecord
|
|||
end
|
||||
|
||||
def sections
|
||||
siblings.filter(&:header_section?)
|
||||
siblings&.filter(&:header_section?)
|
||||
end
|
||||
|
||||
def mandatory_and_blank?
|
||||
|
|
|
@ -23,7 +23,7 @@ class Champs::HeaderSectionChamp < Champ
|
|||
end
|
||||
|
||||
def libelle_with_section_index
|
||||
if sections.none?(&:libelle_with_section_index?)
|
||||
if sections&.none?(&:libelle_with_section_index?)
|
||||
"#{section_index}. #{libelle}"
|
||||
else
|
||||
libelle
|
||||
|
|
Loading…
Reference in a new issue