Skip to content

Commit

Permalink
Ensure an empty array is returned when no users are found
Browse files Browse the repository at this point in the history
  • Loading branch information
samhsuqld committed May 10, 2016
1 parent ea42636 commit 6d5dbf7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/SUQLD/GoogleAppCurl.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ public function findUsers(array $fields = [])
$fullUrl = self::URL_USERS . '?' . http_build_query($params);
$result = $this->curlRequest($fullUrl);

$users = $result->users;
if (isset($result->users)) {
$users = $result->users;
} else {
$users = [];
}

while (isset($result->nextPageToken)) {
$params['pageToken'] = $result->nextPageToken;
Expand Down

0 comments on commit 6d5dbf7

Please sign in to comment.