Skip to content

Commit

Permalink
Check if name scope is set before trying to return firstName or lastName
Browse files Browse the repository at this point in the history
  • Loading branch information
theedov committed Jul 23, 2020
1 parent 754769b commit a45b7cd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Provider/AppleResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ public function getAttribute($key)
*/
public function getFirstName()
{
return $this->getAttribute('name')['firstName'];
$name = $this->getAttribute('name');
if (isset($name)) {
return $name['firstName'];
}
return null;
}

/**
Expand All @@ -66,7 +70,11 @@ public function getId()
*/
public function getLastName()
{
return $this->getAttribute('name')['lastName'];
$name = $this->getAttribute('name');
if (isset($name)) {
return $name['lastName'];
}
return null;
}

/**
Expand Down

0 comments on commit a45b7cd

Please sign in to comment.