ly-wang19 ab74d6a3b2
fix(export): guard toPoints() against arc-first SVG paths (#638)
An SVG path whose first command is an arc (A) — or one whose leading
commands push no anchor point — reaches the arc branch with an empty
`points` array, so `points[points.length - 1].type` threw a TypeError
and aborted the entire PPTX export. toPoints() documents that a malformed
path should return [] (mirroring getSvgPathRange) so a single bad or
LLM-hallucinated shape does not take down the export; this restores that
contract with a `!lastPoint` guard. Adds a regression test for the
arc-first case.

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: wyuc <wang-yc24@mails.tsinghua.edu.cn>
2026-06-06 10:46:48 -04:00
..