From 5bd886b93006b86eef3e0e25e6768e2cecf94e14 Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Sun, 19 Oct 2025 15:15:05 +0200 Subject: [PATCH] add check --- src/App/TopPanel.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/App/TopPanel.tsx b/src/App/TopPanel.tsx index bdc046a..421756a 100644 --- a/src/App/TopPanel.tsx +++ b/src/App/TopPanel.tsx @@ -172,14 +172,16 @@ export function TopPanel({rt, rtIdx, time, setTime, onInit, onClear, onRaise, on function onSkip() { const now = performance.now(); - setTime(time => { - if (time.kind === "paused") { - return {kind: "paused", simtime: nextTimedTransition[0]}; - } - else { - return {kind: "realtime", scale: time.scale, since: {simtime: nextTimedTransition[0], wallclktime: now}}; - } - }); + if (nextTimedTransition) { + setTime(time => { + if (time.kind === "paused") { + return {kind: "paused", simtime: nextTimedTransition[0]}; + } + else { + return {kind: "realtime", scale: time.scale, since: {simtime: nextTimedTransition[0], wallclktime: now}}; + } + }); + } } function onSlower() {