fix: tighten recipient_emails guard to reject empty list
send_max_budget_alert_email previously guarded with `is not None`, which accepts `[]` and then crashes on `recipient_emails[0]` inside _get_email_params. The current caller (_handle_multi_threshold_max_budget_alert) already filters empty lists upstream, but the public method signature makes no such guarantee — a future caller passing [] would hit IndexError. Switch to truthiness so both None and [] fall through to the single-recipient path.
This commit is contained in:
parent
029d9bcfc7
commit
0a4b02fe76
@ -359,7 +359,7 @@ class BaseEmailLogger(CustomLogger):
|
||||
else "N/A"
|
||||
)
|
||||
|
||||
if recipient_emails is not None:
|
||||
if recipient_emails:
|
||||
# Multi-threshold path: batch send with generic key-based greeting
|
||||
email_params = await self._get_email_params(
|
||||
email_event=EmailEvent.max_budget_alert,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user