From 496306958f207914808bcd3bac4444b6fda2cd9d Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 15 Jun 2024 12:20:25 +0800 Subject: [PATCH] fix build --- lib/utils/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils/index.js b/lib/utils/index.js index fde20064..0b3f46c2 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -374,6 +374,9 @@ export const scanAndConvertToLinks = node => { * @returns */ export function getLastSegmentFromUrl(url) { + if (!url) { + return '' + } // 去掉 URL 中的查询参数部分 const trimmedUrl = url.split('?')[0] // 获取最后一个斜杠后面的内容