[#2258] Make linked menus more robust in the face of bad configuration

This commit is contained in:
Frederic Merizen 2018-09-12 10:05:59 +02:00
parent 9c65b65a03
commit 695426316c

View file

@ -27,7 +27,7 @@ class TypesDeChamp::LinkedDropDownListTypeDeChamp < TypesDeChamp::TypeDeChampBas
chunked.map do |chunk|
primary, *secondary = chunk
secondary.unshift('')
[PRIMARY_PATTERN.match(primary)[1], secondary]
[PRIMARY_PATTERN.match(primary)&.[](1), secondary]
end
end
end