Skip to content

Commit

Permalink
Merge pull request #26622 from pradeepmdk/fix/26558-appcrash-on-dista…
Browse files Browse the repository at this point in the history
…nce-feature

26558-App crashes while using distance feature
  • Loading branch information
Hayata Suenaga authored Sep 4, 2023
2 parents 44721d2 + 59b6e51 commit f85e7ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/DistanceRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {ScrollView, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import lodashGet from 'lodash/get';
import lodashHas from 'lodash/has';
import lodashIsNull from 'lodash/isNull';
import PropTypes from 'prop-types';
import _ from 'underscore';

Expand Down Expand Up @@ -98,7 +99,7 @@ function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken})
() =>
_.filter(
_.map(waypoints, (waypoint, key) => {
if (!waypoint || !lodashHas(waypoint, 'lat') || !lodashHas(waypoint, 'lng')) {
if (!waypoint || !lodashHas(waypoint, 'lat') || !lodashHas(waypoint, 'lng') || lodashIsNull(waypoint.lat) || lodashIsNull(waypoint.lng)) {
return;
}

Expand Down

0 comments on commit f85e7ae

Please sign in to comment.