check events cursor before comparing timestamp

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent e339ebb90b
commit f0c2258371

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 {