mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-16 06:19:21 +00:00
The captured GSAP timeline can temporarily be an object that lacks .time() or .duration() methods (e.g. during init or when a non-GSAP adapter is driving animation). Optional chaining only guards against null/undefined, not against a truthy object missing the method. Add safeTimelineTime/safeTimelineDuration helpers that check typeof before calling, matching the defensive pattern already used by getTimelineDurationSeconds in init.ts. Apply them to every bare .time()/.duration() call in the player: getTime, getDuration, play (duration + time reads), and pause (time read). Fixes PRINFRA-175 (~29 unhandled errors/month).