recorder interface: fix unrelated empty-csv saving bug

pull/3456/head
Rob Pilling 2024-06-16 15:38:03 +01:00
parent 7e7945b6e2
commit ecf1f2ed95
1 changed files with 4 additions and 0 deletions

View File

@ -127,6 +127,10 @@ function saveGPX(track, title) {
} }
function saveCSV(track, title) { function saveCSV(track, title) {
if(!track[0]){
showToast(`Can't save empty csv "${title}" (no headers)`, "error");
return;
}
var headers = Object.keys(track[0]); var headers = Object.keys(track[0]);
var csv = headers.join(",")+"\n"; var csv = headers.join(",")+"\n";
track.forEach(t=>{ track.forEach(t=>{