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] // 获取最后一个斜杠后面的内容