From 6ce6d0c7c55547632b211445faef9bc3f5938f05 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Tue, 1 Dec 2020 19:45:35 +0800 Subject: [PATCH] fix: product hunt today (#6305) --- lib/routes/producthunt/today.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/producthunt/today.js b/lib/routes/producthunt/today.js index 0b52e0784..1152b7d6f 100644 --- a/lib/routes/producthunt/today.js +++ b/lib/routes/producthunt/today.js @@ -11,11 +11,11 @@ module.exports = async (ctx) => { title: 'Product Hunt Today Popular', link: 'https://www.producthunt.com/', item: list.map((l) => { - const img = `https://ph-files.imgix.net/${data[l.thumbnail.id].image_uuid}?auto=format&auto=compress&codec=mozjpeg&cs=strip&w=150&h=150&fit=crop`; + const img = l.thumbnail ? `https://ph-files.imgix.net/${data[l.thumbnail.id].image_uuid}?auto=format&auto=compress&codec=mozjpeg&cs=strip&w=150&h=150&fit=crop` : ''; return { title: l.name, - description: `${l.tagline}
`, + description: `${l.tagline}
${img === '' ? '' : ``}`, link: 'https://www.producthunt.com/posts/' + l.slug, pubDate: new Date(l.updated_at), };