Skip to content

Commit b2df6a1

Browse files
authored
Merge pull request #1268 from IFRCGo/fix/local-unit-health-facility-type
Add optional chaining in the usage of local unit health facility type
2 parents da2b758 + 195aede commit b2df6a1

File tree

1 file changed

+3
-3
lines changed
  • app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsMap

1 file changed

+3
-3
lines changed

app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsMap/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,11 @@ function LocalUnitsMap(props: Props) {
266266
radius: 12,
267267
type: localUnit.type,
268268
subType: localUnit.type === TYPE_HEALTH_CARE
269-
? localUnit.health_details.health_facility_type
269+
? localUnit.health_details?.health_facility_type
270270
: undefined,
271271
iconKey: isDefined(localUnit.health_details)
272272
? getIconKey(
273-
localUnit.health_details.health_facility_type,
273+
localUnit.health_details?.health_facility_type,
274274
HEALTHCARE_ICON_KEY,
275275
) : getIconKey(localUnit.type, LOCAL_UNIT_ICON_KEY),
276276
},
@@ -367,7 +367,7 @@ function LocalUnitsMap(props: Props) {
367367
/>
368368
),
369369
)}
370-
{localUnitsOptions?.health_facility_type.map(
370+
{localUnitsOptions?.health_facility_type?.map(
371371
(healthTypeOption) => (
372372
<MapImage
373373
key={healthTypeOption.id}

0 commit comments

Comments
 (0)