diff options
author | Lukas Treyer <treyer@arch.ethz.ch> | 2017-10-23 12:03:55 +0300 |
---|---|---|
committer | Lukas Treyer <treyer@arch.ethz.ch> | 2017-10-23 12:03:55 +0300 |
commit | 5f8aaa2d4e93831e329d2203ea9cd42fa32dd2df (patch) | |
tree | 28ed12f48c4dbc55aaf615be82c6cf6853ccf1cd | |
parent | b11acbaf482e3f24d6230d0d3f633f8f8c8db924 (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.py | 5 |
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: |