Check refreshToken isset before attempting to call methods on it

This commit is contained in:
Brooke Bryan 2014-11-13 12:20:59 +00:00
parent b2c0933ee6
commit 6a1f927a6c

View File

@ -259,7 +259,7 @@ class AuthCodeGrant extends AbstractGrant
$accessToken->setSession($session); $accessToken->setSession($session);
$accessToken->save(); $accessToken->save();
if ($refreshToken && $this->server->hasGrantType('refresh_token')) { if (isset($refreshToken) && $this->server->hasGrantType('refresh_token')) {
$refreshToken->setAccessToken($accessToken); $refreshToken->setAccessToken($accessToken);
$refreshToken->save(); $refreshToken->save();
} }