mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 19:34:31 +02:00
Fixed exception on edit page for parts.
This commit is contained in:
parent
329d8c871e
commit
d2a8055384
1 changed files with 5 additions and 2 deletions
|
@ -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!'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue