Skip to content

Commit

Permalink
fix: indent exist check before accessing its property (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinal005 authored Jan 5, 2024
1 parent a678c2f commit b963483
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tomlkit/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,7 @@ def __delitem__(self, key: int | slice):
if (
idx == 0
and len(self._value) > 0
and self._value[idx].indent
and "\n" not in self._value[idx].indent.s
):
# Remove the indentation of the first item if not newline
Expand Down

0 comments on commit b963483

Please sign in to comment.