fix(route/huxiu): Prevent URL parsing error. (#14445)

* Update util.js

* Update util.js
This commit is contained in:
Andvari 2024-02-12 23:49:46 +08:00 committed by GitHub
parent fc84c92b95
commit 03d13d27c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -334,7 +334,7 @@ const processItems = async (items, limit, tryGet) => {
if (item.moment_id) {
guid = `huxiu-moment-${item.moment_id}`;
link = item.url ?? new URL(`moment/${item.moment_id}.html`, rootUrl).href;
link = item.url || new URL(`moment/${item.moment_id}.html`, rootUrl).href;
} else if (item.brief_id || /huxiu\.com\/brief\//.test(item.url)) {
item.brief_id = item.brief_id ?? item.aid;
guid = `huxiu-brief-${item.brief_id}`;