diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-07-23 20:15:49 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-07-25 21:17:58 -0400 |
| commit | e0cecd6fa444e3b7ea2391ce4f2953ae9fd5f3fa (patch) | |
| tree | 594303377f13fc8e33eaefceb60b26f2ace033e3 /lib/stitch_plan | |
| parent | 5ce8df77a07b11b902792d299d4cb89b6951ccd8 (diff) | |
fix a couple crashes
Diffstat (limited to 'lib/stitch_plan')
| -rw-r--r-- | lib/stitch_plan/stitch_plan.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py index 0fa87d71..a7cd60e8 100644 --- a/lib/stitch_plan/stitch_plan.py +++ b/lib/stitch_plan/stitch_plan.py @@ -45,6 +45,10 @@ def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM): color_block.add_stitch(stop=True) color_block = stitch_plan.new_color_block(color_block.color) + if len(color_block) == 0: + # last block ended in a stop, so now we have an empty block + del stitch_plan.color_blocks[-1] + stitch_plan.filter_duplicate_stitches() stitch_plan.add_ties() |
