mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 00:00:44 +02: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:
@@ -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'))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user