From 59b6e5168552e7656d052be22e978e71f465be94 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Mon, 4 Sep 2023 01:24:06 +0530 Subject: [PATCH] update type safty --- src/components/DistanceRequest.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index 19a3b9ec6926..fc2d18d76ecd 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -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'; @@ -96,7 +97,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; }