From 211d34b5c9030daa61d3a209f6ad55b63fcc5157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=8F=B6?= <1936472877@qq.com> Date: Wed, 27 Nov 2024 18:01:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/utils/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/utils/index.js b/models/utils/index.js index 74d9d73..e7d5f5d 100644 --- a/models/utils/index.js +++ b/models/utils/index.js @@ -188,6 +188,7 @@ export async function sendGroupMsg (botId, gid, msg) { * @returns {string} */ export function getHeaderImgUrlByAppid (appid) { + if (!appid) return '' return `https://steamcdn-a.akamaihd.net/steam/apps/${appid}/header.jpg` } @@ -197,6 +198,7 @@ export function getHeaderImgUrlByAppid (appid) { * @returns {Promise} */ export async function getImgUrlBuffer (url) { + if (!url) return null for (let i = 0; i < 3; i++) { try { const buffer = await request.get(url, { responseType: 'arraybuffer', baseUrl: '' }).then(res => res.data)