Skip to content

Commit

Permalink
fix: thumbnail response types
Browse files Browse the repository at this point in the history
  • Loading branch information
ianshade committed Oct 5, 2023
1 parent 76e8fd3 commit c70b530
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shared/packages/tsr-bridge/src/sideload/CasparCG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ export class CasparCGSideload implements SideLoadDevice {

const thumbnail = await thumbnailQuery.request
if (this._isSuccessful(thumbnail)) {
resource.thumbnail = thumbnail.data && this._toPngDataUri(thumbnail.data[0])
const thumbnailData =
Array.isArray(thumbnail.data) && typeof thumbnail.data[0] === 'string'
? thumbnail.data[0]
: undefined
resource.thumbnail = thumbnailData && this._toPngDataUri(thumbnailData)
TMP_THUMBNAIL_LIMIT--
} // else: probably CasparCG's media-scanner isn't running
} catch (error) {
Expand Down

0 comments on commit c70b530

Please sign in to comment.