mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
Unchecked index causes IndexError.
This commit is contained in:
parent
3a319b9a84
commit
bcfab26d78
1 changed files with 2 additions and 0 deletions
|
@ -205,6 +205,8 @@ class Crypttab(object):
|
|||
for line in self._lines:
|
||||
lines.append(str(line))
|
||||
crypttab = '\n'.join(lines)
|
||||
if len(crypttab) == 0:
|
||||
crypttab += '\n'
|
||||
if crypttab[-1] != '\n':
|
||||
crypttab += '\n'
|
||||
return crypttab
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue