From 3806ba04f60b7d76e318565ae7e1cf654432fe78 Mon Sep 17 00:00:00 2001
From: Eileen McNaughton <emcnaughton@wikimedia.org>
Date: Thu, 27 Jan 2022 21:58:07 -0800
Subject: [PATCH] dev/core#3028 - For invalid greetings, return '' instead of
 failing

---
 CRM/Contact/BAO/Contact.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php
index 329ed5e421..5f63159d4f 100644
--- a/CRM/Contact/BAO/Contact.php
+++ b/CRM/Contact/BAO/Contact.php
@@ -3543,7 +3543,7 @@ LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id )
       'contact_type' => $contact->contact_type,
       'greeting_type' => $greetingType,
     ];
-    return CRM_Core_PseudoConstant::greeting($filter)[$contact->{$idField}];
+    return CRM_Core_PseudoConstant::greeting($filter)[$contact->{$idField}] ?? '';
   }
 
   /**
-- 
2.25.1