Unchecked index causes IndexError.
This commit is contained in:
parent
542a96f907
commit
773d402eac
1 changed files with 2 additions and 0 deletions
|
@ -205,6 +205,8 @@ class Crypttab(object):
|
||||||
for line in self._lines:
|
for line in self._lines:
|
||||||
lines.append(str(line))
|
lines.append(str(line))
|
||||||
crypttab = '\n'.join(lines)
|
crypttab = '\n'.join(lines)
|
||||||
|
if len(crypttab) == 0:
|
||||||
|
crypttab += '\n'
|
||||||
if crypttab[-1] != '\n':
|
if crypttab[-1] != '\n':
|
||||||
crypttab += '\n'
|
crypttab += '\n'
|
||||||
return crypttab
|
return crypttab
|
||||||
|
|
Loading…
Reference in a new issue