diff --git a/src/main.ts b/src/main.ts index 40ac937..9c7cd53 100644 --- a/src/main.ts +++ b/src/main.ts @@ -688,6 +688,7 @@ function parseDuration(duration: string): number { } function formatDuration(seconds: number): string { + if (!isFinite(seconds) || seconds < 0) return '00:00:00'; const h = Math.floor(seconds / 3600); const m = Math.floor((seconds % 3600) / 60); const s = Math.floor(seconds % 60); @@ -695,6 +696,7 @@ function formatDuration(seconds: number): string { } function formatDurationDashed(seconds: number): string { + if (!isFinite(seconds) || seconds < 0) return '00-00-00'; const h = Math.floor(seconds / 3600); const m = Math.floor((seconds % 3600) / 60); const s = Math.floor(seconds % 60);