diff options
author | bptato <nincsnevem662@gmail.com> | 2025-01-15 01:25:53 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2025-01-15 01:28:04 +0100 |
commit | ebdf6ba3641c67ab22e0de0c8851ac97fb0ea75b (patch) | |
tree | 49d2df7d3d07dc05a23a776380047b66700aa409 /src | |
parent | 7ea0ed47932550c5316887f7f606e70df1c49da3 (diff) | |
download | chawan-ebdf6ba3641c67ab22e0de0c8851ac97fb0ea75b.tar.gz |
buffer: add back node nil checks
Actually, I'm not sure if this can be nil, especially in anonymous table boxes...
Diffstat (limited to 'src')
-rw-r--r-- | src/server/buffer.nim | 4 |
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) |