Skip to content

Commit

Permalink
Fix PHPStan warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrenssen committed Sep 11, 2023
1 parent fd9a040 commit db692ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/GraphQL/Buffers/SubRequestBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Drupal\Core\Url;
use Drupal\Core\Routing\LocalRedirectResponse;
use Drupal\graphql\SubRequestResponse;
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\HttpKernelInterface;
Expand Down Expand Up @@ -106,8 +107,11 @@ protected function createRequest(Request $current, array $buffer, string $url) {
}, $buffer);
});

if ($session = $current->getSession()) {
$request->setSession($session);
// Pass the current session to the sub request if it exists.
try {
$request->setSession($current->getSession());
}
catch (SessionNotFoundException) {
}

return $request;
Expand Down

0 comments on commit db692ec

Please sign in to comment.