Merge pull request #2471 from eileenmcnaughton/CRM-14148
[civicrm-core.git] / CRM / Contact / BAO / Contact.php
index fb579c60f774197bf6b9859c805df85b00331050..f0dce175149bf9fb1e663162db1a22855e96b80f 100644 (file)
@@ -2512,7 +2512,9 @@ AND       civicrm_openid.is_primary = 1";
     // fields that are required to calculate greeting and
     // also other fields used in tokens etc,
     // hence we need to retrieve it again.
-    $contact->find(TRUE);
+    if ( $contact->_query !== FALSE ) {
+      $contact->find(TRUE);
+    }
 
     // store object values to an array
     $contactDetails = array();