[Bf-extensions-cvs] [5f8aaa2d] master: 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 Oct 23 11:03:41 CEST 2017


Commit: 5f8aaa2d4e93831e329d2203ea9cd42fa32dd2df
Author: Lukas Treyer
Date:   Mon Oct 23 11:03:55 2017 +0200
Branches: master
https://developer.blender.org/rBA5f8aaa2d4e93831e329d2203ea9cd42fa32dd2df

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