forked from extern/egroupware
handle php-warning for attachmentobjects not set properly
This commit is contained in:
parent
ae2049db28
commit
d302d78435
@ -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')));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user