Skip to content

Commit

Permalink
Merge pull request #25 from spwilson806/master
Browse files Browse the repository at this point in the history
[#24] Add additional checks to ensure no attempts to access undefined array offset
  • Loading branch information
spwilson806 committed Dec 4, 2015
2 parents 884e4c8 + c44d452 commit 1370539
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public function email()

if (isset($bio->{'contact-details'})) {
if (isset($bio->{'contact-details'}->email)) {
$email = $bio->{'contact-details'}->email[0]->value;
if (is_array($bio->{'contact-details'}->email) && isset($bio->{'contact-details'}->email[0])) {
$email = $bio->{'contact-details'}->email[0]->value;
}
}
}

Expand Down

0 comments on commit 1370539

Please sign in to comment.