Skip to content

Commit df45dc1

Browse files
committed
CRM-16095 - Don't lookup empty contact_id in db
1 parent 10329d4 commit df45dc1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/civicrm_contact_ref/civicrm_contact_ref.module

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,15 @@ function _civicrm_contact_ref_potential_references_standard($field, $string = ''
400400
/**
401401
* Helper function for formatters.
402402
*
403-
* Store node titles collected in the curent request.
403+
* Store node titles collected in the current request.
404+
*
405+
* @param int $cid
406+
* @param string $field
407+
* @return string|null
404408
*/
405409
function _civicrm_contact_ref_titles($cid, $field = 'display_name') {
406-
if (!civicrm_initialize()) {
407-
return;
410+
if (!civicrm_initialize() || !$cid) {
411+
return NULL;
408412
}
409413
static $titles = array();
410414

0 commit comments

Comments
 (0)