check if source_media_type exists - fixes channel pages not rendering

This commit is contained in:
Sean Yesmunt 2020-04-08 14:50:14 -04:00
parent d94610acb1
commit 0644eb3642

View file

@ -66,7 +66,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}) {
let imageThumbnail;
if (Number(claim.fee) <= 0 && claim.source_media_type.startsWith('image/')) {
if (Number(claim.fee) <= 0 && claim.source_media_type && claim.source_media_type.startsWith('image/')) {
imageThumbnail = generateStreamUrl(claim.name, claim.claim_id, undefined, undefined, true);
}
const claimThumbnail = escapeHtmlProperty(claim.thumbnail_url) || imageThumbnail || `${URL}/v1-og.png`;