Skip to content

Commit ce7ea6c

Browse files
author
Daniil Zhilin
committed
Add fix
1 parent b0d03cc commit ce7ea6c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

components/api.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ export class Trope {
8686
const titleElement = document.querySelector(
8787
".wrap-entry-breadcrumb strong"
8888
);
89-
const text = Array.prototype.filter
90-
.call(
91-
titleElement?.childNodes,
92-
(child) => child.nodeType === Node.TEXT_NODE
93-
)
94-
.map((child) => child.textContent)
95-
.join("");
89+
const text = titleElement
90+
? Array.prototype.filter
91+
.call(
92+
titleElement?.childNodes,
93+
(child) => child.nodeType === Node.TEXT_NODE
94+
)
95+
.map((child) => child.textContent)
96+
.join("")
97+
: null;
9698
if (text) {
9799
return text.trim();
98100
}

0 commit comments

Comments
 (0)