fix(type de champ): do not raise error if tdc already destroyed
This commit is contained in:
parent
3627d7cae1
commit
00561999ec
1 changed files with 1 additions and 1 deletions
|
@ -74,7 +74,7 @@ module Administrateurs
|
|||
def destroy
|
||||
coordinate, type_de_champ = draft.coordinate_and_tdc(params[:stable_id])
|
||||
|
||||
if coordinate.used_by_routing_rules?
|
||||
if coordinate&.used_by_routing_rules?
|
||||
errors = "« #{type_de_champ.libelle} » est utilisé pour le routage, vous ne pouvez pas le supprimer."
|
||||
@morphed = [champ_component_from(coordinate, focused: false, errors:)]
|
||||
flash.alert = errors
|
||||
|
|
Loading…
Reference in a new issue