Skip to content

Commit

Permalink
fix gene ads
Browse files Browse the repository at this point in the history
  • Loading branch information
smallpath committed Feb 5, 2018
1 parent f7d572d commit e6699eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion psnine/parser/gene.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export default function (html) {
const text = $this.text()
const arr = text.split('\n').map(item => item.replace(/\t/g, '').trim()).filter(item => item)

const matched = $this.find('.content')[0].parent.attribs.href.match(/\d+/)
const target = $this.find('.content')
if (!target) return
if (!target.length) return
const matched = target[0].parent.attribs.href.match(/\d+/)
const id = matched ? matched[0] : arr[1] + arr[2]
const nextArr = arr.slice(-3)
let circle = $this.find('a.node').text() || ''
Expand Down

0 comments on commit e6699eb

Please sign in to comment.