From b043a2fb5e87b3309330c6699174939156757380 Mon Sep 17 00:00:00 2001 From: Enguerran Weiss Date: Mon, 9 Dec 2024 15:14:51 +0100 Subject: [PATCH] AppellationAutocomplete getOption label bugfix --- .../forms/autocomplete/AppellationAutocomplete.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/front/src/app/components/forms/autocomplete/AppellationAutocomplete.tsx b/front/src/app/components/forms/autocomplete/AppellationAutocomplete.tsx index 25ea70aefc..204163b979 100644 --- a/front/src/app/components/forms/autocomplete/AppellationAutocomplete.tsx +++ b/front/src/app/components/forms/autocomplete/AppellationAutocomplete.tsx @@ -147,7 +147,10 @@ export const AppellationAutocomplete = ({ }) : "Saisissez un métier" } - getOptionLabel={(option) => option.appellation.appellationLabel ?? ""} + getOptionLabel={(option: AppellationMatchDto | undefined) => { + if (!option || !option.appellation) return ""; + return option.appellation.appellationLabel; + }} id={id} renderOption={(props, option) => (