Skip to content
This repository was archived by the owner on Jun 14, 2021. It is now read-only.

Commit b223ff5

Browse files
author
XiaoLin
committed
fix: error when screenshots not exist
1 parent fa3c911 commit b223ff5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/module/javbus.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,16 @@ module.exports = async (JAVID) => {
100100
}
101101
}
102102

103-
const s = dom.getElementById('sample-waterfall').getElementsByTagName('a')
104-
for (const i in s) {
105-
const item = s[i]
106-
console.log(item.attributes)
107-
if (item.attributes[1]) data.screenshots.push(item.attributes[1].value)
103+
let s = dom.getElementById('sample-waterfall')
104+
if (s) {
105+
s = s.getElementsByTagName('a')
106+
for (const i in s) {
107+
const item = s[i]
108+
console.log(item.attributes)
109+
if (item.attributes[1]) data.screenshots.push(item.attributes[1].value)
110+
}
108111
}
109-
112+
110113
logger.debug(JAVID, data)
111114

112115
if (!data || !data.tags.length || !data.stars.length) {

0 commit comments

Comments
 (0)