Fix exception when creating an attachment without an file.,

This commit is contained in:
Jan Böhmer 2022-12-18 20:55:38 +01:00
parent 8ae4e9fe05
commit 07b399763a

View file

@ -223,7 +223,7 @@ class AttachmentSubmitHandler
//Determine the old filepath //Determine the old filepath
$old_path = $this->pathResolver->placeholderToRealPath($attachment->getPath()); $old_path = $this->pathResolver->placeholderToRealPath($attachment->getPath());
if (!file_exists($old_path)) { if (empty($old_path) || !file_exists($old_path)) {
return $attachment; return $attachment;
} }
$filename = basename($old_path); $filename = basename($old_path);