mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Handle case where block is empty -- not sure if it ever happens, but let's not error out unnecessarily
This commit is contained in:
parent
ae23800e53
commit
3d4f822be0
1 changed files with 1 additions and 2 deletions
|
|
@ -520,8 +520,7 @@ def _add_directives(block, directives, replace):
|
|||
"""
|
||||
for directive in directives:
|
||||
_add_directive(block, directive, replace)
|
||||
last = block[-1]
|
||||
if not '\n' in last: # could be " \n " or ["\n"] !
|
||||
if block and '\n' not in block[-1]: # could be " \n " or ["\n"] !
|
||||
block.append(nginxparser.UnspacedList('\n'))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue