Skip to content

Commit e5bac05

Browse files
Merge pull request #1370 from nukeador/dev
fix: prevent "name is undefined" error in CompanyIcon component
2 parents c78409a + c40744b commit e5bac05

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: lib/components/util/company-icon-internal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const CompanyIcon = ({
1212
fallbackContent = null,
1313
...otherProps
1414
}: Props): ReactElement | null => {
15-
const CompanyIcon = getCompanyIcon ? getCompanyIcon(company) : null
15+
const CompanyIcon = getCompanyIcon && company ? getCompanyIcon(company) : null
1616
return CompanyIcon ? (
1717
<Suspense fallback={<span>{company}</span>}>
1818
<CompanyIcon {...otherProps} />

Diff for: lib/components/viewers/nearby/rental-station.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const RentalStation = ({ companies, fromToSlot, place }: Props) => {
2525

2626
const stationIcon = (
2727
<CompanyIcon
28-
company={company}
28+
company={company || ''}
2929
fallbackContent={<Bicycle />}
3030
height={22}
3131
style={{ marginRight: '5px' }}

Diff for: lib/components/viewers/nearby/vehicle-rent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const Vehicle = ({
9797
<IconWithText
9898
icon={
9999
<CompanyIcon
100-
company={vehicle.network}
100+
company={vehicle.network || ''}
101101
fallbackContent={getVehicleIcon(formFactor)}
102102
height={22}
103103
style={{ marginRight: '5px' }}

0 commit comments

Comments
 (0)