summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/elements/satin_column.py2
-rw-r--r--lib/stitches/auto_satin.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py
index 16e7b01f..ff5cfe86 100644
--- a/lib/elements/satin_column.py
+++ b/lib/elements/satin_column.py
@@ -1025,9 +1025,9 @@ class SatinColumn(EmbroideryElement):
"""
for path_list in path_lists:
- num_paths = len(path_list)
if path_list is None:
continue
+ num_paths = len(path_list)
if num_paths in (2, 4):
# Add the rung just after the start of the satin.
# If the rails have opposite directions it may end up at the end of the satin.
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():