Skip to content

Commit 7b6c9ab

Browse files
authored
ROU-12040: Dealing with route not found (#211)
1 parent 46031a4 commit 7b6c9ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Providers/Maps/Google/Features/Directions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ namespace Provider.Maps.Google.Feature {
107107

108108
/** Sets the route in the map based on the response from the Google Maps Routes API. */
109109
private _setRouteInMap(response: Types.RoutesResponse): OSFramework.Maps.OSStructures.ReturnMessage {
110-
if (response.routes.length > 0) {
110+
if (response?.routes?.length > 0) {
111111
const firstRoute = response.routes[0];
112112
this._currRouteTime = parseInt(firstRoute.duration);
113113
this._currRouteDistance = firstRoute.distanceMeters;

0 commit comments

Comments
 (0)