From 07b399763af06cd31c05ff279094b9433ac209a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 18 Dec 2022 20:55:38 +0100 Subject: [PATCH] Fix exception when creating an attachment without an file., --- src/Services/Attachments/AttachmentSubmitHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Attachments/AttachmentSubmitHandler.php b/src/Services/Attachments/AttachmentSubmitHandler.php index 18ec6896..9feaa11c 100644 --- a/src/Services/Attachments/AttachmentSubmitHandler.php +++ b/src/Services/Attachments/AttachmentSubmitHandler.php @@ -223,7 +223,7 @@ class AttachmentSubmitHandler //Determine the old filepath $old_path = $this->pathResolver->placeholderToRealPath($attachment->getPath()); - if (!file_exists($old_path)) { + if (empty($old_path) || !file_exists($old_path)) { return $attachment; } $filename = basename($old_path);