diff --git a/routes/api/tracks.js b/routes/api/tracks.js index 71ae71f..5a835e1 100644 --- a/routes/api/tracks.js +++ b/routes/api/tracks.js @@ -66,6 +66,10 @@ function addPointsToTrack(track,body) { f = parseFloat(token.substring(0,10)); } + if(isNaN(f)) + { + f=0.0; + } track.trackData.points[track.trackData.points.length - 1].latitude = f; num++; } @@ -75,6 +79,10 @@ function addPointsToTrack(track,body) { f = parseFloat(token.substring(0,10)); } + if(isNaN(f)) + { + f=0.0; + } track.trackData.points[track.trackData.points.length - 1].longitude = f; num++; } @@ -84,6 +92,10 @@ function addPointsToTrack(track,body) { f = parseFloat(token.substring(0,10)); } + if(isNaN(f)) + { + f=0.0; + } track.trackData.points[track.trackData.points.length - 1].course = f; num++; } @@ -93,6 +105,10 @@ function addPointsToTrack(track,body) { f = parseFloat(token.substring(0,10)); } + if(isNaN(f)) + { + f=0.0; + } track.trackData.points[track.trackData.points.length - 1].speed = f; num++; }