Improve typescript null checking in places (#10073 (#10073

* Improve typescript null checking in places

* Iterate

* Fix Timer.ts
This commit is contained in:
Michael Telatynski
2023-02-03 15:27:47 +00:00
committed by GitHub
parent 97506cbcdb
commit 9743852380
43 changed files with 155 additions and 154 deletions

View File

@@ -47,9 +47,9 @@ export function tooltipifyLinks(rootNodes: ArrayLike<Element>, ignoredNodes: Ele
if (
node.tagName === "A" &&
node.getAttribute("href") &&
node.getAttribute("href") !== node.textContent.trim()
node.getAttribute("href") !== node.textContent?.trim()
) {
let href = node.getAttribute("href");
let href = node.getAttribute("href")!;
try {
href = new URL(href, window.location.href).toString();
} catch (e) {