From b1724378ec7614204d024967d0756dad73c69ea6 Mon Sep 17 00:00:00 2001 From: Chris Raby Date: Mon, 15 Feb 2016 11:04:45 +0000 Subject: [PATCH] Resolve issue with "Undefined property: stdClass::$bytes" --- src/Fetch/Attachment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fetch/Attachment.php b/src/Fetch/Attachment.php index e77984a..39793b6 100644 --- a/src/Fetch/Attachment.php +++ b/src/Fetch/Attachment.php @@ -98,7 +98,9 @@ public function __construct(Message $message, $structure, $partIdentifier = null $this->setFileName($parameters['name']); } - $this->size = $structure->bytes; + if(isset($structure->bytes)){ + $this->size = $structure->bytes; + } $this->mimeType = Message::typeIdToString($structure->type);