Skip to content

Commit

Permalink
Don't check last tool switch height if no tool changes
Browse files Browse the repository at this point in the history
- would crash when no tool changes
  • Loading branch information
spegelius committed Sep 27, 2017
1 parent c3a299c commit 9bb0ff9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcode_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def parse_print_settings(self):
if not self.layers[0].start_gcode_end:
raise ValueError("Cannot find 'START SCRIPT END'-comment. Please add it to your Slicer's config")

self.last_switch_height = max(self.last_switch_heights.items())[1]
if self.last_switch_heights:
self.last_switch_height = max(self.last_switch_heights.items())[1]

def open_file(self, gcode_file):
""" Read given g-code file into list """
Expand Down

0 comments on commit 9bb0ff9

Please sign in to comment.