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
committerBastien Montagne <montagne29@wanadoo.fr>2018-01-01 18:23:12 +0300
commit6b26c0c1ec360884d2b1e874ab5ed124a0a7d602 (patch)
tree5261e615ebe167ac1eea2555c1362a0670294af2
parent1f868b2e5d05d31bd0186d14b04fd5a86e6f20f8 (diff)
Wrap array access for width property in a if-statement to avoid errors with empty arrays. see T53094.
-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: