We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46031a4 commit 7b6c9abCopy full SHA for 7b6c9ab
1 file changed
src/Providers/Maps/Google/Features/Directions.ts
@@ -107,7 +107,7 @@ namespace Provider.Maps.Google.Feature {
107
108
/** Sets the route in the map based on the response from the Google Maps Routes API. */
109
private _setRouteInMap(response: Types.RoutesResponse): OSFramework.Maps.OSStructures.ReturnMessage {
110
- if (response.routes.length > 0) {
+ if (response?.routes?.length > 0) {
111
const firstRoute = response.routes[0];
112
this._currRouteTime = parseInt(firstRoute.duration);
113
this._currRouteDistance = firstRoute.distanceMeters;
0 commit comments