CRM-16076 - Avoid unnecessary query for empty image fields
authorColeman Watts <coleman@civicrm.org>
Fri, 13 Mar 2015 02:19:44 +0000 (22:19 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 13 Mar 2015 02:19:44 +0000 (22:19 -0400)
CRM/Core/BAO/CustomField.php

index d46ffb013987d3985409d46acfc574b256cd855f..883db2ae36ed2570047c15d31022c860c275e088 100644 (file)
@@ -1287,7 +1287,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
 
       case 'File':
         // In the context of displaying a profile, show file/image
-        if ($contactID) {
+        if ($contactID && $value) {
           $url = self::getFileURL($contactID, $fieldID, $value);
           if ($url) {
             $display = $url['file_url'];