Skip to content

Commit

Permalink
Catch Nette/Image exception
Browse files Browse the repository at this point in the history
If Nette image was unable to create image, for example due to GD exception, ImageException is thrown.
  • Loading branch information
krekos committed Mar 19, 2020
1 parent bf4c969 commit 0f14534
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Storages/LocalStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ protected function getLink(IResource $resource): ?string {
$image = $this->imageFactory->createFromFile($originalPath);
} catch (UnknownImageFileException $e) {
return null;
} catch (ImageException $e){
return null;
}
} else {
throw new ImageStorageException('Resource must be instance of ITransferResource or IFileResource.');
Expand Down

0 comments on commit 0f14534

Please sign in to comment.