apache: fix crash when authenticating empty vhosts (#8941)

Fixes #8940.
This commit is contained in:
alexzorin
2021-07-15 11:12:14 -07:00
committed by GitHub
parent 8e29063ba7
commit a105b587ac
5 changed files with 17 additions and 2 deletions
@@ -440,7 +440,11 @@ class ApacheParser:
:type args: list or str
"""
first_dir = aug_conf_path + "/directive[1]"
self.aug.insert(first_dir, "directive", True)
if self.aug.get(first_dir):
self.aug.insert(first_dir, "directive", True)
else:
self.aug.set(first_dir, "directive")
self.aug.set(first_dir, dirname)
if isinstance(args, list):
for i, value in enumerate(args, 1):