From a84b66eb88e20d3aed478535d9c33308245d3c5b Mon Sep 17 00:00:00 2001 From: bain Date: Sun, 19 Jan 2025 14:52:30 +0100 Subject: [PATCH] fix shell completion when cfg has server block w/o server_name --- ncc/certs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ncc/certs.py b/ncc/certs.py index 4d4594a..89ad62a 100644 --- a/ncc/certs.py +++ b/ncc/certs.py @@ -65,7 +65,7 @@ def get_sites(cfg: Path) -> Generator[Tuple[Path, str]]: config_part = _remove_comments(c[1]) for server_block in _get_server_blocks(config_part): - sn = next(re.finditer(SERVER_NAME_RE, server_block)) + sn = next(re.finditer(SERVER_NAME_RE, server_block), None) if not sn: continue