Browse Source

Prevent exceptions when spine is empty

CURA-2083
Jaime van Kessel 8 years ago
parent
commit
0aad5ef5ed
1 changed files with 2 additions and 0 deletions
  1. 2 0
      plugins/X3DReader/X3DReader.py

+ 2 - 0
plugins/X3DReader/X3DReader.py

@@ -425,6 +425,8 @@ class X3DReader(MeshReader):
             # All the spines are collinear. Fallback to the rotated source
             # XZ plane.
             # TODO: handle the situation where the first two spine points match
+            if len(spine) < 2:
+                return Vector(0, 0, 1)
             v = spine[1] - spine[0]
             orig_y = Vector(0, 1, 0)
             orig_z = Vector(0, 0, 1)