[Bf-extensions-cvs] [6b26c0c1] blender-v2.79a-release: Wrap array access for width property in a if-statement to avoid errors with empty arrays. see T53094.

Lukas Treyer noreply at git.blender.org
Mon Jan 1 16:36:26 CET 2018


Commit: 6b26c0c1ec360884d2b1e874ab5ed124a0a7d602
Author: Lukas Treyer
Date:   Mon Oct 23 11:03:55 2017 +0200
Branches: blender-v2.79a-release
https://developer.blender.org/rBA6b26c0c1ec360884d2b1e874ab5ed124a0a7d602

Wrap array access for width property in a if-statement to avoid errors with empty arrays. see T53094.

===================================================================

M	io_import_dxf/dxfimport/do.py

===================================================================

diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py
index 3d474d25..8954ba54 100644
--- a/io_import_dxf/dxfimport/do.py
+++ b/io_import_dxf/dxfimport/do.py
@@ -1135,7 +1135,10 @@ class Do:
             return
         has_varying_width = is_.varying_width(entity)
         th = entity.thickness
-        w = entity.width[0][0] if hasattr(entity, "width") else 0
+        w = 0
+        if hasattr(entity, "width"):
+            if len(entity.width) > 0 and len(entity.width[0]) > 0:
+                w = entity.width[0][0]
 
         if w == 0 and not has_varying_width:
             if th != 0:



More information about the Bf-extensions-cvs mailing list