Skip to content
This repository was archived by the owner on Dec 6, 2019. It is now read-only.

Commit cf90787

Browse files
Nabeel Shahzadnabeelio
authored andcommitted
Make sure points subarray exists
1 parent aacb49a commit cf90787

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/templates/route_map.tpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,15 @@ let points = [];
9191
points.push(depCoords);
9292
9393
// rendering for if there's smartcars data
94-
if(flight.rawdata instanceof Object && Array.isArray(flight.rawdata.points)) {
94+
if(flight.rawdata instanceof Object
95+
&& flight.rawdata.points !== undefined
96+
&& Array.isArray(flight.rawdata.points)
97+
) {
9598
$.each(flight.rawdata.points, function(i, nav) {
9699
if(nav.lat === undefined || nav.lng === undefined) {
97100
return;
98101
}
99-
102+
100103
points.push(L.latLng(nav.lat, nav.lng));
101104
});
102105
} else {

0 commit comments

Comments
 (0)