mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-16 07:58:38 +00:00
fix(crm): guard first_contact result before indexing (lead conversion time)
Address review (#56105): the IS NOT NULL guard can return no rows (the count above filters on sender, this query on recipients), so [0][0] would raise IndexError. Fall back to None when empty, matching the prior behaviour for that case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -130,7 +130,8 @@ def get_communication_details(filters):
|
||||
LIMIT 1
|
||||
""",
|
||||
(d.contact_email),
|
||||
)[0][0]
|
||||
)
|
||||
first_contact = first_contact[0][0] if first_contact else None
|
||||
|
||||
duration = flt(date_diff(invoice[0][0], first_contact))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user