diff --git a/apps/android/boot.js b/apps/android/boot.js index 6b7d81b72c..666cac6d37 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -236,8 +236,12 @@ "listRecs": function() { let recs = require("Storage").list(/^recorder\.log.*\.csv$/,{sf:true}).map(s => s.slice(12, 21)); if (event.id.length > 2) { // Handle if there was no id supplied. Then we send a list all available recorder logs back. - let isFirstNonsyncedIdx = recs.findIndex((logId) => logId > event.id); - recs = recs.slice(isFirstNonsyncedIdx+1); + let firstNonsyncedIdx = recs.findIndex((logId) => logId > event.id); + if (-1 == firstNonsyncedIdx) { + recs = [] + } else { + recs = recs.slice(firstNonsyncedIdx); + } } gbSend({t:"actTrksList", list: recs}); // TODO: split up in multiple transmissions? },