Skip to content

Commit

Permalink
Fix user search with 0 results
Browse files Browse the repository at this point in the history
  • Loading branch information
danmichaelo committed Jun 18, 2018
1 parent 35e4ee4 commit 5d827e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Users/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public function search($query, $full = false, $batchSize = 10)
while (true) {
$response = $this->client->getJSON('/users', ['q' => $query, 'limit' => $batchSize, 'offset' => $offset]);

if ($response->total_record_count == 0) {
break;
}

foreach ($response->user as $data) {
$user = User::fromResponse($this->client, $data);
if ($full) {
Expand Down

0 comments on commit 5d827e5

Please sign in to comment.