Skip to content

Commit

Permalink
fix replacing values in an empty list #4578
Browse files Browse the repository at this point in the history
  • Loading branch information
Durman committed Sep 22, 2022
1 parent ae175fb commit 5638fb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nodes/list_struct/item_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def set_items(self, data, new_items, indexes):
data_out = data.copy() if isinstance(data, list) else list(data)
params = list_match_func[self.list_match_local]([indexes, new_items])
if self.replace:
if not data_out: # ignore empty input
return data_out
min_ind = -len(data_out)
max_ind = len(data_out) - 1
for ind, i in zip(*params):
Expand Down

0 comments on commit 5638fb4

Please sign in to comment.