From 5f8aaa2d4e93831e329d2203ea9cd42fa32dd2df Mon Sep 17 00:00:00 2001 From: Lukas Treyer Date: Mon, 23 Oct 2017 11:03:55 +0200 Subject: Wrap array access for width property in a if-statement to avoid errors with empty arrays. see T53094. --- io_import_dxf/dxfimport/do.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'io_import_dxf') 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: -- cgit v1.2.3