diff --git a/main-support.ts b/main-support.ts index 47376e60..0b76adad 100644 --- a/main-support.ts +++ b/main-support.ts @@ -391,9 +391,13 @@ export function extractAllMetadata( * @param metadata the ffProbe metadata object */ function getBestStream(metadata) { - return metadata.streams.reduce(function (a, b) { - return a.width > b.width ? a : b; - }); + try { + return metadata.streams.reduce((a, b) => a.width > b.width ? a : b); + } catch (e) { + // if metadata.streams is an empty array or something else is wrong with it + // return an empty object so later calls to `stream.width` or `stream.height` do not throw exceptions + return {}; + } } /** diff --git a/src/app/components/views/thumbnail/preview.component.html b/src/app/components/views/thumbnail/preview.component.html index d6f65541..3cc1783b 100644 --- a/src/app/components/views/thumbnail/preview.component.html +++ b/src/app/components/views/thumbnail/preview.component.html @@ -7,8 +7,6 @@ [ngClass]="{ 'compact-margins': compactView }" > - -