diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index bc90416..d484fdc 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -383,7 +383,7 @@ async function blueskyQuoteEmbed(quote) { const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint; const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${quote.author.did}&cid=${embed.cid}`; - videos.push({media: {url: videoUrl}, description: embed.alt.length > 0 ? embed.alt : null}); + videos.push({media: {url: videoUrl}, description: embed.alt?.length > 0 ? embed.alt : null}); break; } case "app.bsky.embed.recordWithMedia#view": { @@ -399,7 +399,7 @@ async function blueskyQuoteEmbed(quote) { const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint; const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${quote.author.did}&cid=${embed.media.cid}`; - videos.push({media: {url: videoUrl}, description: embed.alt.length > 0 ? embed.alt : null}); + videos.push({media: {url: videoUrl}, description: embed.alt?.length > 0 ? embed.alt : null}); } break; } @@ -520,7 +520,7 @@ async function bluesky(msg, url, spoiler = false) { const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint; const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${post.author.did}&cid=${post.embed.cid}`; - videos.push({media: {url: videoUrl}, description: post.embed.alt.length > 0 ? post.embed.alt : null}); + videos.push({media: {url: videoUrl}, description: post.embed.alt?.length > 0 ? post.embed.alt : null}); break; } case "app.bsky.embed.record#view": { @@ -550,7 +550,7 @@ async function bluesky(msg, url, spoiler = false) { const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint; const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${post.author.did}&cid=${post.embed.media.cid}`; - videos.push({media: {url: videoUrl}, description: post.embed.alt.length > 0 ? post.embed.alt : null}); + videos.push({media: {url: videoUrl}, description: post.embed.alt?.length > 0 ? post.embed.alt : null}); } else if (post.embed.media.$type === "app.bsky.embed.external#view") { if (post.embed.media.external.uri.includes("tenor.com")) { const url = new URL(post.embed.media.external.uri);