添加源存在性检查

This commit is contained in:
lyswhut
2022-11-04 15:18:25 +08:00
parent 9e6bfaada4
commit 303d712860
15 changed files with 26 additions and 24 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ export const search = async(text: string, page: number, sourceId: LX.OnlineSourc
let task = []
for (const source of sources) {
if (source == 'all') continue
task.push(music[source].musicSearch.search(text, page, listInfos.all.limit).catch((error: any) => {
task.push((music[source]?.musicSearch.search(text, page, listInfos.all.limit) ?? Promise.reject(new Error('source not found: ' + source))).catch((error: any) => {
console.log(error)
return {
allPage: 1,