catch exception when no description
authorDemeritCowboy <demeritcowboy@hotmail.com>
Sat, 17 Aug 2019 01:31:42 +0000 (21:31 -0400)
committerDemeritCowboy <demeritcowboy@hotmail.com>
Sat, 17 Aug 2019 01:31:42 +0000 (21:31 -0400)
CRM/Core/BAO/CustomField.php

index 695deacabab55e08c31a6fefa23e41ff554bc2c3..07530e3f5228135718df1b361cc8e8a480e0515e 100644 (file)
@@ -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