Skip to content

Commit

Permalink
fix: Fixed an issue where using a transform method other than Craft a…
Browse files Browse the repository at this point in the history
…long with `asset.getUrl()` in your templates could throw an exception ([#363](#363))
  • Loading branch information
khalwat committed Nov 17, 2022
1 parent 19c21a3 commit 03e74e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ImageOptimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,12 @@ static function (ImageTransformerOperationEvent $event): void {
__METHOD__
);
// Return the path to the optimized image to _createTransformForAsset()
$event->path = ImageOptimize::$plugin->optimize->handleGenerateTransformEvent(
$tempPath = ImageOptimize::$plugin->optimize->handleGenerateTransformEvent(
$event
);
if ($tempPath) {
$event->tempPath = $tempPath;
}
}
);

Expand Down

0 comments on commit 03e74e6

Please sign in to comment.