mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Unchecked index causes IndexError.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user