* @param string $table
*
* @return array|null
+ *
*/
public static function &lastModified($id, $table = 'civicrm_contact') {
$log->entity_id = $id;
$log->orderBy('modified_date desc');
$log->limit(1);
- $result = NULL;
+ $displayName = $result = $contactImage = NULL;
if ($log->find(TRUE)) {
- list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($log->modified_id);
+ if ($log->modified_id) {
+ list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($log->modified_id);
+ }
$result = array(
'id' => $log->modified_id,
'name' => $displayName,