From 14e7c5454ec0d983c1540b8b951b1fa737e3374c Mon Sep 17 00:00:00 2001 From: Abdelaziz MISBAH Date: Thu, 9 Jun 2022 11:47:34 +0100 Subject: [PATCH] FIX #21141 Update condition to check for attached file to E-mail Template Update condition to check for attached file to E-ail Template, initial Commit doesn't check for if null (may generate fatal error depending on context), now we check if is an object, before checking if we join files. --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e66b378ca38..92e0272c00c 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -615,7 +615,7 @@ class Notify $ref = dol_sanitizeFileName($newref); $pdf_path = $dir_output."/".$ref.".pdf"; - if (!dol_is_file($pdf_path)||!$arraydefaultmessage->joinfiles) { + if (!dol_is_file($pdf_path)||(is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { // We can't add PDF as it is not generated yet. $filepdf = ''; } else {