diff --git a/modules/ui/elevation-profile.js b/modules/ui/elevation-profile.js index c47c833c..995f0270 100644 --- a/modules/ui/elevation-profile.js +++ b/modules/ui/elevation-profile.js @@ -83,7 +83,7 @@ function showElevationProfile(data, routeLen, isRiver) { chartData.ma = Math.max(chartData.ma, chartData.height[i]); } - if (lastBurgIndex != 0 && lastBurgCell == chartData.cell[data.length-1] && lastBurgIndex < data.length) { + if (lastBurgIndex != 0 && lastBurgCell == chartData.cell[data.length-1] && lastBurgIndex < data.length-1) { chartData.burg[data.length-1] = chartData.burg[lastBurgIndex]; chartData.burg[lastBurgIndex] = 0; }