Ignore non-string mail CLI recipients (#1824)

This commit is contained in:
red person
2026-06-29 05:41:22 -07:00
committed by GitHub
parent 893e490cdc
commit 9731048ecd
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -108,6 +108,8 @@ def _q(name: str) -> str:
def _split_recipients(value: str) -> list[str]:
if not isinstance(value, str):
return []
return [r.strip() for r in (value or "").split(",") if r.strip()]
+7
View File
@@ -48,3 +48,10 @@ def test_recipient_list_rejects_empty_envelope(monkeypatch):
assert exc.code == 1
else:
raise AssertionError("expected empty recipient list to exit")
def test_split_recipients_ignores_non_string_values(monkeypatch):
cli = _load_mail_cli(monkeypatch)
assert cli._split_recipients(None) == []
assert cli._split_recipients(["a@example.test"]) == []