Skip to content

Commit b9b0a85

Browse files
committed
Check for request and session before using
1 parent 7c97e4e commit b9b0a85

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Twig/Extension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ public function __construct(
3434
string $domain
3535
) {
3636
$this->intuition = $intuition;
37-
$this->session = $requestStack->getSession();
37+
if ($requestStack->getCurrentRequest() && $requestStack->getCurrentRequest()->hasSession()) {
38+
$this->session = $requestStack->getCurrentRequest()->getSession();
39+
}
3840
$this->domain = $domain;
3941
}
4042

0 commit comments

Comments
 (0)