diff src/layout/suffixLabels.ts @ 128:5a1a79f54779

big rewrite
author drewp@bigasterisk.com
date Fri, 05 May 2023 21:26:36 -0700
parents 2468f2227d22
children
line wrap: on
line diff
--- a/src/layout/suffixLabels.ts	Fri May 05 21:23:44 2023 -0700
+++ b/src/layout/suffixLabels.ts	Fri May 05 21:26:36 2023 -0700
@@ -52,7 +52,13 @@
     // one child (since we'll see it again if that one wasn't
     // enough).
     const clashNode: DisplayNode = this.displayNodes.get(curs.usedBy!)!;
-    const nextLeftSeg = curs.children.entries().next().value;
+    const e = curs.children.entries()
+    const n = e.next()
+    if (n.done) {
+      return; // todo - this ignores the bad url
+      throw new Error()
+    }
+    const nextLeftSeg = n.value
     if (nextLeftSeg[1].usedBy) {
       throw new Error("unexpected");
     }