Skip to content

Commit b963483

Browse files
authored
fix: indent exist check before accessing its property (#328)
1 parent a678c2f commit b963483

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tomlkit/items.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ def __delitem__(self, key: int | slice):
14121412
if (
14131413
idx == 0
14141414
and len(self._value) > 0
1415+
and self._value[idx].indent
14151416
and "\n" not in self._value[idx].indent.s
14161417
):
14171418
# Remove the indentation of the first item if not newline

0 commit comments

Comments
 (0)