check events cursor before comparing timestamp

This commit is contained in:
Yanzhen Yu
2021-04-23 18:49:27 +08:00
parent ed990536bc
commit 2b96a68e88

View File

@@ -243,7 +243,7 @@ export function createPlayerService(
addDelay(event, baselineTime);
let end = events.length - 1;
if (events[end].timestamp <= event.timestamp) {
if (!events[end] || events[end].timestamp <= event.timestamp) {
// fast track
events.push(event);
} else {