aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/LinkManager.ts
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-11-02 02:12:19 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-11-02 02:12:19 -0400
commita1d00a36ef1afa97198a825bd25ebb4c5e598848 (patch)
treee0c0454c99938562132794333a22e490e3e37cb9 /src/client/util/LinkManager.ts
parent78d8261522c0079b0298613a856547a9ac96ef50 (diff)
parent84c15417f2247fc650a9f7b2c959479519bd3ebb (diff)
Merge branch 'master' into sophie-ai-images
Diffstat (limited to 'src/client/util/LinkManager.ts')
-rw-r--r--src/client/util/LinkManager.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/util/LinkManager.ts b/src/client/util/LinkManager.ts
index a533fdd1f..ba53a760f 100644
--- a/src/client/util/LinkManager.ts
+++ b/src/client/util/LinkManager.ts
@@ -202,8 +202,8 @@ export class LinkManager {
public static getOppositeAnchor(linkDoc: Doc, anchor: Doc): Doc | undefined {
const a1 = Cast(linkDoc.link_anchor_1, Doc, null);
const a2 = Cast(linkDoc.link_anchor_2, Doc, null);
- if (Doc.AreProtosEqual(DocCast(anchor.annotationOn, anchor), DocCast(a1.annotationOn, a1))) return a2;
- if (Doc.AreProtosEqual(DocCast(anchor.annotationOn, anchor), DocCast(a2.annotationOn, a2))) return a1;
+ if (Doc.AreProtosEqual(DocCast(anchor.annotationOn, anchor), DocCast(a1?.annotationOn, a1))) return a2;
+ if (Doc.AreProtosEqual(DocCast(anchor.annotationOn, anchor), DocCast(a2?.annotationOn, a2))) return a1;
if (Doc.AreProtosEqual(anchor, linkDoc)) return linkDoc;
}
}