diff --git a/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx b/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx index 1df190788..1846fada0 100644 --- a/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx +++ b/packages/app/src/app/(default)/index-egapro/declaration/commencer/CommencerForm.tsx @@ -106,11 +106,11 @@ export const prepareDataWithExistingDeclaration = async ( entreprise: { ...baseFormData.entreprise, entrepriseDéclarante: { - adresse: company?.firstMatchingEtablissement.address.includes("[ND]") + adresse: company.firstMatchingEtablissement.address?.includes("[ND]") ? "Information non diffusible" : company?.firstMatchingEtablissement.address, codeNaf: company.activitePrincipaleUniteLegale, - codePostal: company.firstMatchingEtablissement?.codePostalEtablissement.includes("[ND]") + codePostal: company.firstMatchingEtablissement?.codePostalEtablissement?.includes("[ND]") ? undefined : company.firstMatchingEtablissement?.codePostalEtablissement, codePays: company.firstMatchingEtablissement?.codePaysEtrangerEtablissement @@ -118,7 +118,7 @@ export const prepareDataWithExistingDeclaration = async ( : undefined, raisonSociale: company.simpleLabel, siren, - commune: company.firstMatchingEtablissement?.libelleCommuneEtablissement.includes("[ND]") + commune: company.firstMatchingEtablissement?.libelleCommuneEtablissement?.includes("[ND]") ? undefined : company.firstMatchingEtablissement?.libelleCommuneEtablissement, département: countyCode,