Merge pull request #19525 from eileenmcnaughton/member_soft
[civicrm-core.git] / CRM / Contact / BAO / Query.php
index 4f9874513de8855f388d5a85580bc16f648a7eae..baa41722cd9e9275814e0a82fdffee7f07ce8d16 100644 (file)
@@ -1112,8 +1112,10 @@ class CRM_Contact_BAO_Query {
         }
 
         $field = $this->_fields[$elementName] ?? NULL;
-        if (isset($this->_pseudoConstantsSelect[$field['name']])) {
-          $this->_pseudoConstantsSelect[$name . '-' . $field['name']] = $this->_pseudoConstantsSelect[$field['name']];
+        if (!empty($field)) {
+          if (isset($this->_pseudoConstantsSelect[$field['name']])) {
+            $this->_pseudoConstantsSelect[$name . '-' . $field['name']] = $this->_pseudoConstantsSelect[$field['name']];
+          }
         }
 
         // hack for profile, add location id