summaryrefslogtreecommitdiff
path: root/lib/elements
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2019-06-19 14:01:43 -0400
committerLex Neva <github.com@lexneva.name>2019-06-22 18:12:50 -0400
commit6a8f385d13ee77910923028e99b01c69adc9e4ba (patch)
tree33609e63346007acae3d15d1a27df9fe5857b422 /lib/elements
parent9fccbb50334225217483639936e8f05912616be0 (diff)
fix IndexError for single-path satin columns (fixes #366)
Diffstat (limited to 'lib/elements')
-rw-r--r--lib/elements/satin_column.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py
index bfa39384..4617860a 100644
--- a/lib/elements/satin_column.py
+++ b/lib/elements/satin_column.py
@@ -325,6 +325,9 @@ class SatinColumn(EmbroideryElement):
self.fatal(_("satin column: object %s has a fill (but should not)") % node_id)
if not self.rungs:
+ if len(self.rails) < 2:
+ self.fatal(_("satin column: object %(id)s has too few paths. A satin column should have at least two paths (the rails).") % dict(id=node_id))
+
if len(self.rails[0]) != len(self.rails[1]):
self.fatal(_("satin column: object %(id)s has two paths with an unequal number of points (%(length1)d and %(length2)d)") %
dict(id=node_id, length1=len(self.rails[0]), length2=len(self.rails[1])))