diff options
author | Ghostkeeper <rubend@tutanota.com> | 2019-01-28 17:54:34 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2019-01-28 17:54:34 +0300 |
commit | 371585a0ba54d8b9106b1e50c918737635aa42b5 (patch) | |
tree | 1585785807cb685632d29b1d4f8ef86ace5093a4 /plugins/GCodeReader | |
parent | 4a91425bf982f01397dbf88e8eb68941e2232338 (diff) |
Fix error if layer number ends up out of range
It normally doesn't go out of range, but some defensive coding just in case it does. And to fix a typing error of course.
Diffstat (limited to 'plugins/GCodeReader')
-rw-r--r-- | plugins/GCodeReader/FlavorParser.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py index baf21d47ce..f8618712a1 100644 --- a/plugins/GCodeReader/FlavorParser.py +++ b/plugins/GCodeReader/FlavorParser.py @@ -107,6 +107,8 @@ class FlavorParser: self._layer_data_builder.setLayerHeight(self._layer_number, path[0][2]) self._layer_data_builder.setLayerThickness(self._layer_number, layer_thickness) this_layer = self._layer_data_builder.getLayer(self._layer_number) + if not this_layer: + return False except ValueError: return False count = len(path) |