Skip to content

Commit

Permalink
Catch IndexError when importing data (#5439) (#5443)
Browse files Browse the repository at this point in the history
* Catch IndexError when importing data

* Also handle TypeError

(cherry picked from commit 93e4dad)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
  • Loading branch information
github-actions[bot] and SchrodingersGat committed Aug 14, 2023
1 parent 3b238fd commit b8e726d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion InvenTree/part/views.py
Expand Up @@ -168,7 +168,11 @@ def get_field_selection(self):
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:
Expand Down

0 comments on commit b8e726d

Please sign in to comment.