From 93e4dadb49b1cbe304ed9654af8f9d1d944c112e Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 14 Aug 2023 15:21:41 +1000 Subject: [PATCH] Catch IndexError when importing data (#5439) * Catch IndexError when importing data * Also handle TypeError --- InvenTree/part/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 25b5312a60..d236dfbe62 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -168,7 +168,11 @@ class PartImport(FileManagementFormView): for row in self.rows: # check each submitted column for idx in col_ids: - data = row['data'][col_ids[idx]]['cell'] + + try: + data = row['data'][col_ids[idx]]['cell'] + except (IndexError, TypeError): + continue if idx in self.file_manager.OPTIONAL_MATCH_HEADERS: try: