Skip to content

Commit

Permalink
Validate response (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmeijer97 authored Nov 28, 2023
1 parent 7a86b1e commit b40929c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Actions/HarvestReviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ public function harvest(): void
'start' => 0,
]);

$total = $firstResponse->json('count')['total'];
$total = $firstResponse->json('count')['total'] ?? false;

if (!$total) {
info('No totals found, aborting..');
return;
}

if($total > $pageSize) {
$responses = Http::pool(function (Pool $pool) use ($total, $pageSize, $auth) {
Expand Down

0 comments on commit b40929c

Please sign in to comment.