From 5fb9b230241a99aac4985505731d954a3c773c70 Mon Sep 17 00:00:00 2001 From: Jan Romaniak Date: Thu, 12 Dec 2024 16:00:00 +0100 Subject: [PATCH] AB#226656 Error Cannot read properties of undefined Grievance ticket --- .../LookUps/LookUpReassignRole/LookUpReassignRole.tsx | 2 +- .../src/components/grievances/ReassignMultipleRoleBox.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/LookUpReassignRole.tsx b/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/LookUpReassignRole.tsx index 65202a7b2a..f17f40daaa 100644 --- a/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/LookUpReassignRole.tsx +++ b/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/LookUpReassignRole.tsx @@ -119,7 +119,7 @@ export function LookUpReassignRole({ return ( el.role === IndividualRoleInHouseholdRole.Primary || el.role === 'HEAD', ); - const mappedReassignLookups = (): ReactElement => ( <> {selectedIndividualsToReassign.map((selectedIndividualToReassign) => { @@ -97,7 +96,7 @@ export function ReassignMultipleRoleBox({ ticket={ticket} household={householdAndRole.household} individualToReassign={selectedIndividualToReassign} - initialSelectedIndividualId={reassignDataDictByIndividualId[selectedIndividualToReassign.id].new_individual} + initialSelectedIndividualId={reassignDataDictByIndividualId[selectedIndividualToReassign.id]?.new_individual} /> )); @@ -137,7 +136,7 @@ export function ReassignMultipleRoleBox({ ticket={ticket} household={household} individualToReassign={selectedIndividualToReassign} - initialSelectedIndividualId={reassignDataDictByIndividualId[selectedIndividualToReassign.id].new_individual} + initialSelectedIndividualId={reassignDataDictByIndividualId[selectedIndividualToReassign.id]?.new_individual} /> )}