summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-04-18 19:03:20 +0200
committerGitHub <noreply@github.com>2025-04-18 19:03:20 +0200
commit04fcf8fd1395be1d4a0ef5706f9f2dccceb0c7fb (patch)
tree0cac087625d26433bb59d60cd24f25e4526149c1 /lib/stitches
parentbd472d4bd75926cbf90ccddea63aa0b36294860f (diff)
Fix an issue when auto_satin produces NoneType satins (#3680)
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/auto_satin.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/stitches/auto_satin.py b/lib/stitches/auto_satin.py
index d01ef7b8..22d489db 100644
--- a/lib/stitches/auto_satin.py
+++ b/lib/stitches/auto_satin.py
@@ -87,6 +87,10 @@ class SatinSegment(object):
if self.end < 1.0:
satin, after = satin.split(None, cut_points=end)
+ # the cut operation can lead to a NoneType element
+ if satin is None:
+ return
+
if self.reverse:
satin = satin.reverse()
@@ -552,7 +556,10 @@ def operations_to_elements_and_trims(operations, preserve_order):
# Ignore JumpStitch operations. Jump stitches in Ink/Stitch are
# implied and added by Embroider if needed.
if isinstance(operation, (SatinSegment, RunningStitch)):
- elements.append(operation.to_element())
+ element = operation.to_element()
+ if not element:
+ continue
+ elements.append(element)
original_parent_nodes.append(operation.original_node.getparent())
elif isinstance(operation, (JumpStitch)):
if elements and operation.should_trim():