Skip to content

Commit 1d691c7

Browse files
committed
修复filter&必须全部填写的bug
1 parent 489349d commit 1d691c7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,10 @@ async function getAssets(request, owner, repo, version, filter) {
308308
for (const asset of resp.assets) {
309309
const name = asset.name
310310

311-
if ( (flt[1] === '' || name.search(flt[1]) !== -1 ) &&
312-
(flt[2] === '' || name.search(flt[2]) === -1 ) &&
313-
(flt[3] === '' || name.startsWith(flt[3]) ) &&
314-
(flt[4] === '' || name.endsWith(flt[4]) ) ) {
311+
if ( (flt[1] === '' || flt[1] === undefined || name.search(flt[1]) !== -1 ) &&
312+
(flt[2] === '' || flt[2] === undefined || name.search(flt[2]) === -1 ) &&
313+
(flt[3] === '' || flt[3] === undefined || name.startsWith(flt[3]) ) &&
314+
(flt[4] === '' || flt[4] === undefined || name.endsWith(flt[4]) ) ) {
315315
target = asset.browser_download_url;
316316
count++;
317317
}

0 commit comments

Comments
 (0)