Skip to content

Commit

Permalink
Bail early if keys is null
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Sep 24, 2024
1 parent 5f62217 commit 1c8c8a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Repositories/RedisRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ public function chunk(string $pattern, int $count): Generator
'count' => $count,
]);

yield $keys;
if (is_null($keys)) {
return;
}

if (! empty($keys)) {
yield $keys;
}
} while ($cursor !== '0');
}

Expand Down

0 comments on commit 1c8c8a9

Please sign in to comment.