Skip to content

Commit

Permalink
Fix crash on unsupported cell interfaces (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathn authored May 31, 2024
1 parent 76e31a6 commit bb83251
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lotemplate/Statement/TableStatement.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from com.sun.star.lang import XComponent
from com.sun.star.sheet import XCellRangeData
from typing import Union
import lotemplate.errors as errors
import regex
Expand Down Expand Up @@ -46,7 +47,10 @@ def scan_cell(cell) -> None:
tab_vars = {}
list_tab_vars = []
for i in range(doc.getTextTables().getCount()):
table_data = doc.getTextTables().getByIndex(i).getDataArray()
table = doc.getTextTables().getByIndex(i)
if not isinstance(table, XCellRangeData):
continue
table_data = table.getDataArray()
t_name = doc.getTextTables().getByIndex(i).getName()
nb_rows = len(table_data)
for row_i, row in enumerate(table_data):
Expand Down

0 comments on commit bb83251

Please sign in to comment.