From f5322f00e32d87b83af40b9b54e98c63cd5f23f5 Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Sun, 3 Jan 2021 18:53:46 +0100 Subject: [PATCH] Implement safety fallback for duration display. --- frontend/components/VideoListItem.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/components/VideoListItem.tsx b/frontend/components/VideoListItem.tsx index c5d66b4..7ea5533 100644 --- a/frontend/components/VideoListItem.tsx +++ b/frontend/components/VideoListItem.tsx @@ -34,7 +34,11 @@ export default function VideoListItem({ }) { let displayDuration = null; if (duration !== null) { - displayDuration = duration; + if (typeof duration === 'string') { + displayDuration = parseFloat(duration); + } else { + displayDuration = duration; + } } else if ( sourceVideoStart !== null && sourceVideoEnd !== null