From c9187e6ec9688fea7a9f870e980a80e7e0fea2e6 Mon Sep 17 00:00:00 2001 From: Ian Morland Date: Sun, 12 Nov 2023 18:45:53 +0000 Subject: [PATCH] fix: php 7.x --- extend.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extend.php b/extend.php index 46191ad..dde8517 100644 --- a/extend.php +++ b/extend.php @@ -73,7 +73,10 @@ (new Extend\ApiSerializer(CurrentUserSerializer::class)) ->attributes(function (CurrentUserSerializer $serializer, User $user, array $attributes) { $session = $serializer->getRequest()->getAttribute('session'); - $attributes['loginProvider'] = $session?->get(AbstractOAuthController::SESSION_OAUTH2PROVIDER); + + if ($session) { + $attributes['loginProvider'] = $session->get(AbstractOAuthController::SESSION_OAUTH2PROVIDER); + } return $attributes; }),