From 8b60a8e44c398d6207dfad70fde0eeb7c07f57c4 Mon Sep 17 00:00:00 2001 From: Ryan Bridge Date: Tue, 19 Jan 2016 20:27:22 -0800 Subject: [PATCH] Add check for attachment size Signed-off-by: Ryan Bridge --- 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..c9db5e3 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);