summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-04-18 19:09:20 +0200
committerGitHub <noreply@github.com>2025-04-18 19:09:20 +0200
commita40b810721f7cf04a47e569c1b1a4680a3ef61bc (patch)
treea366801171f22b8a88fc97dfa380bf1b183f71f7 /lib/stitches
parent04fcf8fd1395be1d4a0ef5706f9f2dccceb0c7fb (diff)
fix NoneType error in auto_fill travel (#3659)
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/auto_fill.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py
index d5dd1d7d..bcde63e7 100644
--- a/lib/stitches/auto_fill.py
+++ b/lib/stitches/auto_fill.py
@@ -894,6 +894,10 @@ def travel(shape, travel_graph, edge, running_stitch_length, running_stitch_tole
path = [InkstitchPoint.from_tuple(point) for point in path]
if len(path) > 1:
path = clamp_path_to_polygon(path, shape)
+ elif not path:
+ # This may happen on very small shapes.
+ # Simply return nothing as we do not want to error out
+ return []
points = even_running_stitch(path, running_stitch_length, running_stitch_tolerance)
stitches = [Stitch(point) for point in points]