Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Treyer <treyer@arch.ethz.ch>2017-10-23 12:03:55 +0300
committerLukas Treyer <treyer@arch.ethz.ch>2017-10-23 12:03:55 +0300
commit5f8aaa2d4e93831e329d2203ea9cd42fa32dd2df (patch)
tree28ed12f48c4dbc55aaf615be82c6cf6853ccf1cd /io_import_dxf
parentb11acbaf482e3f24d6230d0d3f633f8f8c8db924 (diff)
Wrap array access for width property in a if-statement to avoid errors with empty arrays. see T53094.
Diffstat (limited to 'io_import_dxf')
-rw-r--r--io_import_dxf/dxfimport/do.py5
1 files changed, 4 insertions, 1 deletions
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: