From f1e137350d21d83f86f5019422fa936152b91f85 Mon Sep 17 00:00:00 2001 From: cnk Date: Wed, 19 Feb 2025 22:02:35 +0800 Subject: [PATCH] fix(routes/163/dy): fix post without img error (#18401) --- lib/routes/163/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/163/utils.ts b/lib/routes/163/utils.ts index eab4f0762..7a2e95cba 100644 --- a/lib/routes/163/utils.ts +++ b/lib/routes/163/utils.ts @@ -24,9 +24,9 @@ const parseDyArticle = (item, tryGet) => } }); - const imgUrl = new URL(item.imgsrc); + const imgsrc = item.imgsrc ? new URL(item.imgsrc).searchParams.get('url') : false; item.description = art(path.join(__dirname, 'templates/dy.art'), { - imgsrc: imgUrl.searchParams.get('url'), + imgsrc, postBody: $('.post_body').html(), });