Don't crash when loading model before a printer is loaded

The model won't load successfully and you get a message that it failed to load, but Cura won't crash at least.

Contributes to issue CURA-4736.
This commit is contained in:
Ghostkeeper 2017-12-29 14:47:55 +01:00
parent 1bcdc0357e
commit 4a3109c885
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
2 changed files with 4 additions and 5 deletions

View file

@ -1387,7 +1387,7 @@ class CuraApplication(QtApplication):
if node.callDecoration("isSliceable"):
# Only check position if it's not already blatantly obvious that it won't fit.
if node.getBoundingBox().width < self._volume.getBoundingBox().width or node.getBoundingBox().depth < self._volume.getBoundingBox().depth:
if node.getBoundingBox() is None or self._volume.getBoundingBox() is None or node.getBoundingBox().width < self._volume.getBoundingBox().width or node.getBoundingBox().depth < self._volume.getBoundingBox().depth:
# Find node location
offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(node, min_offset = min_offset)