mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix 什么值得买 (#1771)
在商品比较少的时候,一些列表是空,不应该加进去,否则会出现一些item是undefined 
This commit is contained in:
@@ -15,8 +15,12 @@ module.exports = async (ctx) => {
|
||||
const list1 = [];
|
||||
const list2 = [];
|
||||
for (let i = 0; i < Math.min(6, data.length); i++) {
|
||||
list1.push(data[i][0]);
|
||||
list2.push(data[i][1]);
|
||||
if (data[i][0].length !== 0) {
|
||||
list1.push(data[i][0]);
|
||||
}
|
||||
if (data[i][1].length !== 0) {
|
||||
list2.push(data[i][1]);
|
||||
}
|
||||
}
|
||||
const list = [...list1, ...list2];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user