diff --git a/bskyogcard/src/data/getPostData.ts b/bskyogcard/src/data/getPostData.ts index aa7e62e420..d1c69f182b 100644 --- a/bskyogcard/src/data/getPostData.ts +++ b/bskyogcard/src/data/getPostData.ts @@ -63,20 +63,15 @@ export function getEmbedData(embed: Embed, images: Map) { }) } const player = parseEmbedPlayerFromUrl(embed.view.external.uri) - if (player.type === 'giphy_gif') { - images.set(player.playerUri, { - aspectRatio: { - width: 1000, - height: 1000, - }, - }) - } else if (player.type === 'tenor_gif') { - images.set(player.playerUri, { - aspectRatio: { - width: 1000, - height: 1000, - }, - }) + if (player) { + if (['giphy_gif', 'tenor_gif'].includes(player.type)) { + images.set(player.playerUri, { + aspectRatio: { + width: 1000, + height: 1000, + }, + }) + } } break } diff --git a/bskyogcard/test.html b/bskyogcard/test.html index 61cee38258..1c4bf81906 100644 --- a/bskyogcard/test.html +++ b/bskyogcard/test.html @@ -20,12 +20,30 @@ img {

Image w/ label

+

Image x2

+ +

Image x3

+ +

Image x4

+

Video

Video w/ label

GIF

+

List

+ +

List w/ label

+ +

List (takendown)

+ +

Feed

+ +

Feed w/ label

+ +

Link

+