Skip to content

Commit 09748ec

Browse files
authored
Update ThumbnailExtension.php
1 parent ad67268 commit 09748ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Bridge/Twig/Extension/ThumbnailExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ public function getFunctions(): array
7474

7575
$request = $this->requestStack->getCurrentRequest();
7676
if ($request === null) {
77-
throw new \RuntimeException('Cannot use yassg_thumbnail without a request');
77+
$build = true;
78+
} else {
79+
$build = (bool) $request->attributes->get('yassg_build', false);
7880
}
79-
$build = (bool) $request->attributes->get('yassg_build', false);
8081
$url = sprintf('%1$s/insecure/%2$s%3$s', $this->imgproxyUrl, $filter, $this->encode('local:///'.ltrim($relative, '/')));
8182
if (! $build) {
8283
return $url;

0 commit comments

Comments
 (0)