Don't bomb if original didn't exist (#2295)
If we don't have an existing file, original ends up as None. Bug introduced in 70fa125
This commit is contained in:
parent
d1a4f703ce
commit
b6b04795c3
1 changed files with 1 additions and 1 deletions
2
files/blockinfile.py
Normal file → Executable file
2
files/blockinfile.py
Normal file → Executable file
|
@ -281,7 +281,7 @@ def main():
|
|||
|
||||
if lines:
|
||||
result = '\n'.join(lines)
|
||||
if original.endswith('\n'):
|
||||
if original and original.endswith('\n'):
|
||||
result += '\n'
|
||||
else:
|
||||
result = ''
|
||||
|
|
Loading…
Reference in a new issue