Skip to content

Commit

Permalink
fix: return none if no address
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 25, 2024
1 parent 96c65ff commit b5078b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ def get_contacts(doc):
def get_organization_address(organization):
address = frappe.db.get_value("CRM Organization", organization, "address")
address = frappe.get_doc("Address", address) if address else None
if not address:
return None
return {
"name": address.name,
"address_title": address.address_title,
Expand Down

0 comments on commit b5078b9

Please sign in to comment.