From 0ce992275ae316be72872b6d10a2487c256e31f5 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 9 Sep 2015 17:35:17 -0700 Subject: [PATCH] Wrapping attachment bytes in isset check Creating fork in order to fix issue reported in https://github.com/tedious/Fetch/issues/102 --- src/Fetch/Attachment.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Fetch/Attachment.php b/src/Fetch/Attachment.php index e77984a..4079c5a 100644 --- a/src/Fetch/Attachment.php +++ b/src/Fetch/Attachment.php @@ -97,8 +97,10 @@ public function __construct(Message $message, $structure, $partIdentifier = null } elseif (isset($parameters['name'])) { $this->setFileName($parameters['name']); } - - $this->size = $structure->bytes; + + if (isset($structure->bytes)) { + $this->size = $structure->bytes; + } $this->mimeType = Message::typeIdToString($structure->type);