From 527de6190f2ca2bc8bc72e63e38a381a525ae82c Mon Sep 17 00:00:00 2001 From: Nick Gashkov Date: Thu, 24 Jan 2019 16:33:54 +0300 Subject: [PATCH] Fix #176 --- docxtpl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docxtpl/__init__.py b/docxtpl/__init__.py index 1d27f54..8954057 100644 --- a/docxtpl/__init__.py +++ b/docxtpl/__init__.py @@ -324,7 +324,7 @@ class DocxTemplate(object): def get_cell_len(total, cell): tc_pr = cell.find(ns + 'tcPr') - grid_span = tc_pr is not None and tc_pr.find(ns + 'gridSpan') + grid_span = None if tc_pr is None else tc_pr.find(ns + 'gridSpan') if grid_span is not None: return total + int(grid_span.get(ns + 'val'))