From: DemeritCowboy Date: Sat, 17 Aug 2019 01:31:42 +0000 (-0400) Subject: catch exception when no description X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=419b013b205bb441abda187dfdef875d71286f0c;p=civicrm-core.git catch exception when no description --- diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 695deacaba..07530e3f52 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -1172,7 +1172,16 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { // In other contexts show a paperclip icon if (CRM_Utils_Rule::integer($value)) { $icons = CRM_Core_BAO_File::paperIconAttachment('*', $value); - $display = $icons[$value] . civicrm_api3('File', 'getvalue', ['return' => "description", 'id' => $value]); + + $file_description = ''; + try { + $file_description = civicrm_api3('File', 'getvalue', ['return' => "description", 'id' => $value]); + } + catch (CiviCRM_API3_Exception $dontcare) { + // don't care + } + + $display = "{$icons[$value]}{$file_description}"; } else { //CRM-18396, if filename is passed instead