Fix crash when yande.re post source has no link
parent
593c4cef0d
commit
cfbd9652ec
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "neo-scraper",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.2",
|
||||
"description": "Scrape a booru-like post object from the DOM.",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export default class Moebooru extends ScrapeEngineBase {
|
|||
const matches = el.innerText.match(regex);
|
||||
if (matches && matches.length == 3) {
|
||||
// If Source element
|
||||
if (matches[1] == "Source") {
|
||||
if (matches[1] == "Source" && el.children.length > 0) {
|
||||
post.sources = [(el.children[0] as HTMLAnchorElement).href];
|
||||
}
|
||||
// If Rating element
|
||||
|
|
|
|||
Loading…
Reference in New Issue