Added null checks before calling set functions

This commit is contained in:
Andrew Millington
2018-04-21 21:29:21 +01:00
parent 143afc9561
commit 80bc291c51
5 changed files with 16 additions and 5 deletions

View File

@@ -407,7 +407,10 @@ abstract class AbstractGrant implements GrantTypeInterface
$authCode->setExpiryDateTime((new \DateTime())->add($authCodeTTL));
$authCode->setClient($client);
$authCode->setUserIdentifier($userIdentifier);
$authCode->setRedirectUri($redirectUri);
if ($redirectUri !== null) {
$authCode->setRedirectUri($redirectUri);
}
foreach ($scopes as $scope) {
$authCode->addScope($scope);