Skip to content

Commit 0f573d0

Browse files
committed
Fix crash-causing issues in navigator.
1 parent 9df6950 commit 0f573d0

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

app/component/itinerary/navigator/NaviCardContainer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { matchShape, routerShape } from 'found';
22
import PropTypes from 'prop-types';
33
import React, { useEffect, useRef, useState } from 'react';
4+
import { useIntl } from 'react-intl';
45
import { addAnalyticsEvent } from '../../../util/analyticsUtils';
56
import {
67
isAnyLegPropertyIdentical,
@@ -68,7 +69,8 @@ function NaviCardContainer(
6869
);
6970
const focusRef = useRef(false);
7071

71-
const { intl, config, match, router } = context;
72+
const intl = useIntl();
73+
const { config, match, router } = context;
7274
const platformRef = useRef();
7375

7476
if (legChanged) {

app/util/indoorUtils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ export function getIndoorTranslationId(type, verticalDirection, toLevelName) {
6767
* @return an entrance object or undefined if one can not be found
6868
*/
6969
export function getEntranceObject(previousLeg, leg) {
70+
if (!leg?.steps) {
71+
return undefined;
72+
}
7073
const entranceObjects = leg.steps
7174
.map((step, index) => ({ ...step, index }))
7275
.filter(

0 commit comments

Comments
 (0)