From f57dfcfaf7ded8469510bff92de380b6079905a0 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 7 Dec 2018 22:01:24 +0100 Subject: [PATCH] fallback if preset is missing --- static/js/cccc.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/static/js/cccc.js b/static/js/cccc.js index 4497d3c..6ef7231 100644 --- a/static/js/cccc.js +++ b/static/js/cccc.js @@ -504,7 +504,11 @@ function exportSequenceCSV() { var r = []; r.push(row.preset) var preset = getPreset(row.preset) - r.push(preset.name) + if (preset) { + r.push(preset.name) + } else { + r.push(row.preset) + } if (row.duration) { position += row.duration r.push(formatDuration(position)) @@ -515,9 +519,15 @@ function exportSequenceCSV() { } r.push(row.speed) r.push(row.sleep) - r.push(preset.position.elevation) - r.push(preset.position.azimuth) - r.push(preset.position.absoluteZoom) + if (preset) { + r.push(preset.position.elevation) + r.push(preset.position.azimuth) + r.push(preset.position.absoluteZoom) + } else { + r.push('') + r.push('') + r.push('') + } return r.join(','); })).join('\n'); }