From d302d784359e0c26ff92f104e33d144563cfdcd9 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 20 Dec 2013 13:25:11 +0000 Subject: [PATCH] handle php-warning for attachmentobjects not set properly --- mail/inc/class.mail_bo.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail/inc/class.mail_bo.inc.php b/mail/inc/class.mail_bo.inc.php index 8be96f9828..12c07499da 100644 --- a/mail/inc/class.mail_bo.inc.php +++ b/mail/inc/class.mail_bo.inc.php @@ -4678,12 +4678,12 @@ class mail_bo $this->fetchPartContents($_uid, $attachment, $_stream); } // set name as filename, if not set - if (!$attachment->getDispositionParameter('filename')) + if ($attachment && !$attachment->getDispositionParameter('filename')) { $attachment->setDispositionParameter('filename', $attachment->getName()); } // guess type, if not set - if ($attachment->getType() == 'application/octet-stream') + if ($attachment && $attachment->getType() == 'application/octet-stream') { $attachment->setType(mime_magic::filename2mime($attachment->getDispositionParameter('filename'))); }