diff --git a/src/Actions/HarvestReviews.php b/src/Actions/HarvestReviews.php index cd9fdbf..514d072 100644 --- a/src/Actions/HarvestReviews.php +++ b/src/Actions/HarvestReviews.php @@ -107,9 +107,9 @@ public function harvest(): void info('Finished retrieving reviews.'); } - protected function saveReviews(array $reviews) + protected function saveReviews(?array $reviews) { - foreach($reviews as $review) { + foreach($reviews ?? [] as $review) { $score = round($review['total_score'] * 2); $recommends = $review['recommends'] == config('feedback-company.recommended_value');