aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/LinkManager.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-23 22:02:36 -0400
committerbobzel <zzzman@gmail.com>2025-04-23 22:02:36 -0400
commit78ac87b8acf63079071e5e8805692ed8c30042ce (patch)
treeb8e0cc310733b8651b7c8e020fa3e258d0f460a6 /src/client/util/LinkManager.ts
parent9a46e81d662e59413a076b2e0041d1455bc15294 (diff)
lots of typechecking fixes.
Diffstat (limited to 'src/client/util/LinkManager.ts')
-rw-r--r--src/client/util/LinkManager.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/util/LinkManager.ts b/src/client/util/LinkManager.ts
index 344e2e4c0..d8e0c4cbe 100644
--- a/src/client/util/LinkManager.ts
+++ b/src/client/util/LinkManager.ts
@@ -217,7 +217,8 @@ export class LinkManager {
}
// finds the opposite anchor of a given anchor in a link
- public static getOppositeAnchor(linkDoc: Doc, anchor: Doc): Doc | undefined {
+ public static getOppositeAnchor(linkDoc: Doc | undefined, anchor: Doc | undefined): Doc | undefined {
+ if (!linkDoc || !anchor) return undefined;
const id = LinkManager.anchorIndex(linkDoc, anchor);
const a1 = DocCast(linkDoc.link_anchor_1);
const a2 = DocCast(linkDoc.link_anchor_2);