about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/buffer.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index e8533b1a..a31ae744 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -690,7 +690,7 @@ proc findAnchor(box: InlineBox; anchor: Element): Offset =
       let off = child.findAnchor(anchor)
       if off.y >= 0:
         return off
-  if box.node.element == anchor:
+  if box.node != nil and box.node.element == anchor:
     return box.render.offset
   return offset(-1, -1)
 
@@ -703,7 +703,7 @@ proc findAnchor(box: BlockBox; anchor: Element): Offset =
     let off = child.findAnchor(anchor)
     if off.y >= 0:
       return off
-  if box.node.element == anchor:
+  if box.node != nil and box.node.element == anchor:
     return box.render.offset
   return offset(-1, -1)