From d2a80553844075040f880545ad77765294d05128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 13 Oct 2019 13:27:04 +0200 Subject: [PATCH] Fixed exception on edit page for parts. --- src/Services/Attachments/AttachmentURLGenerator.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Services/Attachments/AttachmentURLGenerator.php b/src/Services/Attachments/AttachmentURLGenerator.php index be7eb536..08892011 100644 --- a/src/Services/Attachments/AttachmentURLGenerator.php +++ b/src/Services/Attachments/AttachmentURLGenerator.php @@ -125,11 +125,14 @@ class AttachmentURLGenerator throw new \InvalidArgumentException('Thumbnail creation only works for picture attachments!'); } + if ($attachment->isExternal()) { + return $attachment->getURL(); + } + $absolute_path = $this->attachmentHelper->toAbsoluteFilePath($attachment); if ($absolute_path === null) { throw new \RuntimeException( - 'The given attachment is external or has no valid file, so no URL can get generated for it! - Use Attachment::getURL() to get the external URL!' + 'The given attachment is external or has no valid file, so no URL can get generated for it!' ); }