diff --git a/api/src/Mail.php b/api/src/Mail.php index 5dd478e853..4a651f1d17 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -6092,7 +6092,7 @@ class Mail * @param string $_part * @param boolean $_stream = null null do NOT fetch content, use fetchPartContents later * true: - * @return Horde_Mime_Part + * @return Horde_Mime_Part|false false on error / not found */ function getAttachmentByCID($_uid, $_cid, $_part, $_stream=null) { @@ -6106,6 +6106,8 @@ class Mail { $structure = $this->getStructure($uid=$_uid, $part=$_part); } + if (!$structure) return false; + /** @var Horde_Mime_Part */ $attachment = null; foreach($structure->contentTypeMap() as $mime_id => $mime_type)