Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit a66923f

Browse files
committed
[FIX] compute_parse_error, Index out of range
1 parent ad4a79c commit a66923f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

camelot/parsers/base.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,14 @@ def compute_parse_errors(self, table):
182182
flag_size=self.flag_size,
183183
strip_text=self.strip_text,
184184
)
185-
if indices[0][:2] != (-1, -1):
186-
pos_errors.append(error)
187-
indices = type(self)._reduce_index(
188-
table, indices, shift_text=self.shift_text
189-
)
190-
for r_idx, c_idx, text in indices:
191-
table.cells[r_idx][c_idx].text = text
185+
if len(indices) > 0:
186+
if indices[0][:2] != (-1, -1):
187+
pos_errors.append(error)
188+
indices = type(self)._reduce_index(
189+
table, indices, shift_text=self.shift_text
190+
)
191+
for r_idx, c_idx, text in indices:
192+
table.cells[r_idx][c_idx].text = text
192193
return pos_errors
193194

194195
def _generate_columns_and_rows(self, bbox, user_cols):

0 commit comments

Comments
 (0)