handle php-warning for attachmentobjects not set properly

This commit is contained in:
Klaus Leithoff 2013-12-20 13:25:11 +00:00
parent ae2049db28
commit d302d78435

View File

@ -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')));
}