Skip to content

Commit d5b7a3f

Browse files
committed
Update unconnected_branch_table.js
- Fix small bug
1 parent 269a4b1 commit d5b7a3f

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/features/unconnected_branch_table/unconnected_branch_table.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,18 @@ async function doNotablesSpace() {
8181
const people = await getPeople(ids.join(","), 0, 0, 0, 0, 0, "Name,Connected", "WBE_unconnected_branch");
8282
const oPeople = people[0].people;
8383
// Add class to rows of any connected people
84-
$table.find("tr").each(function () {
85-
const link = $(this).find("a:first");
86-
87-
if (link.length && link.attr("href").includes("wiki/")) {
88-
const id = link.attr("href").split("/").pop();
89-
const person = Object.values(oPeople).find((p) => p.Name == id);
90-
if (person?.Connected) {
91-
$(this).addClass("connected");
84+
if (oPeople) {
85+
$table.find("tr").each(function () {
86+
const link = $(this).find("a:first");
87+
if (link.length && link.attr("href").includes("wiki/")) {
88+
const id = link.attr("href").split("/").pop();
89+
const person = Object.values(oPeople).find((p) => p.Name == id);
90+
if (person?.Connected) {
91+
$(this).addClass("connected");
92+
}
9293
}
93-
}
94-
});
94+
});
95+
}
9596

9697
setTimeout(function () {
9798
$(".x-sidebar").remove();

0 commit comments

Comments
 (0)