fix(repetition): don't fail when trying to add a row of repetition without champ
Cf procedure#31063 which have stable_id#1078289 without children
This commit is contained in:
parent
bde496b739
commit
4da13f5dc2
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ class Champs::RepetitionController < ApplicationController
|
|||
row = @champ.add_row(@champ.dossier.revision)
|
||||
@first_champ_id = row.map(&:focusable_input_id).compact.first
|
||||
@row_id = row.first&.row_id
|
||||
@row_number = @champ.row_ids.find_index(@row_id) + 1
|
||||
@row_number = @row_id.nil? ? 0 : @champ.row_ids.find_index(@row_id) + 1
|
||||
end
|
||||
|
||||
def remove
|
||||
|
|
Loading…
Reference in a new issue